Adhoc SQL request

Database
KVB
Enthusiast

Adhoc SQL request

Hi All,

Below request has a solution.But need optimal solution.Appreciate your help.

Scenario:

1)I have a table with 160 columns and daily partitioned.Each partition contains 46 million rows.

2)In general it has to store whenever there is a change in any of the 160 columns.

3)During migration, this has been coded wrongly and every record with/without change has been recorded on each day.It had been realized after 3 months.

Task:Now our task is to pull the actual changes into another table with same structure.

Solutions:

1)Compare data in consecutive partitions and pull the record if any change

2)Analytical Functions on whole data(not suggestable  due to volume)

If anyone can throw me some light on this solution then that will help me a lot.

Thanks

KVB