There is data in two tables with same number of comuns(No primary key)-table a for active records and table b for inactive records of a particular firm. Status 'A' is for active and 'I' for inactive
Both of them have same number of columns.How can I compare the data in table a and table b such that if a record exists in b and not a then the status column in A has to be set to 'I' otherwise 'A'
Eg :-
table A
COL1 COL 2 COL3 STATUS
1 one this is one A
2 TO THIS IS TO I
Table B
Col1 col2 Col 3 status
3 THREE 33 A
4 for this is for A
now in table B col1 with 1 does not exist though it exists in table A with status A. Thus after comparing the Table B and Table A we will
update table a
set status ='I'
where col1 =1;
But i am not getting how to compare these two tables ? Kindly help?