captainpicart
Programmer
- Mar 17, 2011
- 4
Hi Techies,
I have two identical tables (1) Employee (2) PreviousEmployee. Now, I need to create only one query/storedProcedure which has to do the following:
1. Get only records which exist only in Employee table but they do not exist in PreviousEmployee table. These records should contain a new column called "Status" and Its value should be "Added".
2. After the above result set, only get modified rows between two tables. For example: employeeID 0067 exist in both tables. and it has been modified in either of these two tables. Still get the modified row from Employee table. THe value of "Status" column for each row would be "Updated".
Thanks!
I have two identical tables (1) Employee (2) PreviousEmployee. Now, I need to create only one query/storedProcedure which has to do the following:
1. Get only records which exist only in Employee table but they do not exist in PreviousEmployee table. These records should contain a new column called "Status" and Its value should be "Added".
2. After the above result set, only get modified rows between two tables. For example: employeeID 0067 exist in both tables. and it has been modified in either of these two tables. Still get the modified row from Employee table. THe value of "Status" column for each row would be "Updated".
Thanks!