I want to copy data from TABLE A to TABLE B based on date range and update the foreign key value in the TABLE A . How to achieve this using sql? i.e
TABLE A
A_id : 11,12,13
A_name : abc,def,efg
A_item: item1, item2, item3
A_date :
B_id : null, null ,null
TABLE B:
B_id : 1, 2, 3...
B_name: abc,def,efg
B_item: item1, item2, item3
After copying data, TABLE A should look like:
TABLE A
A_id : 11,12,13
A_name : abc,def,efg
A_item: item1, item2, item3
A_date :
B_id : 1, 2, 3
Could you please let me know how to update the foreign key value after copying data?