I have a table
| Seq_number | create_dt | col1 | co2 | col3 | is_load |
|---|
| 1 | 1/1/2014 | a | b | c | |
| 2 | 2/1/2014 | d | g | t | |
| 3 | 3/1/2014 | a | b | c | |
| 4 | 3/1/2014 | d | r | y | |
Everyday data is loaded to the table through loader. I want to write a query where it should find the duplicate data in the current day record by comparing with the previous days records and update the column is_load = 'D'(as of Duplicate) if any duplicate record is found.
For example: Above table should be like this
| Seq_number | create_dt | col1 | col2 | col3 | is_load |
|---|
| 1 | 1/1/2014 | a | b | c | |
| 2 | 2/1/2014 | d | g | t | |
| 3 | 3/1/2014 | a | b | c | D |
| 4 | 3/1/2014 | d | r | y | |