I have table called Employee with fields Employee_Name, Employee_Address, Day and this table refreshes on daily basis and has every day date which can be identified from field 'DAY'.
What would be the logic to display all those employees who have updated their Address field. Basically there's a need to compare between DAY and DAY-1 for change in Employee_Address field.
You can use join as follows:
Select t.*, tt.* From your_table t Join your_table tt on t.emp_id = tt.emp_id Where trunc(t.day) = trunc(sysdate) And trunc(tt.day) = trunc(sysdate-1) And t.address <> tt.address
1.4m articles
1.4m replys
5 comments
57.0k users