Skip to content
Advertisement

Select info from row to another row

I have this select on a view:

And get this:

And I want that the last row be like this:

That is, the values of all columns equal to the other rows, except column ‘C’ and column ‘D’. The value of column D is obtained from T2.D

How can I do? Thanks.

Advertisement

Answer

Without any sample data to use I would suggest lag() may be of use in this exact scenario, such as

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement