i m trying to import records from one table to another table.
i m having tables suppose A,B,C,D.
i m importing records from table A to table B.
Table B has two foreign keys which are primary keys in table C and D.
I m using query as below::
INSERT INTO B(userid,behaviorid,userNid,behaviorNid,timestamp)SELECT userid,behaviorid,userNid,behaviorNid,timestamp FROM A where userNid = ANY (select Nid from C);
but i m getting error as foreign key constraints fails.
How can i solve this.
Thanks in advance.
Well this should check
NidinCfor every foreign key in C and append to B.Make sure you try it and comment, if not working