I have a table with more than 80 columns. Table is based on a SCD, which means if there is any change in the value of any of the columns, I insert a new row with the change only in that column, rest of the values remain same.
Now data set (rows) has grown and I need to see the difference between rows. i.e. from first row to second row, which column value changed that let me to create a new row. Similarly from second to third row and so on.
I know this can be achieved through a self join between the table but issue is list of columns is huge and comparing each column doesn’t make sense.
Posting here to see some more efficient way to handle this scenario.
tried doing it using self join but since columns list is huge so solution doesn’t seem to be efficient.
Looking into some some of automatic (store procedure) or predefined function for this.