In sql server 2008, I have a table that has the columns [a],[b],[c],[sort] and it has 4 records:
1, NULL, NULL 0
NULL, 2, NULL 1
NULL, NULL, 3 2
10, NULL, NULL 3
I need to combine all the rows in a way that i get one row as a result, and for each column I get the first (ordered by sort column) non-null value. So my result should be:
1, 2, 3
Can anyone suggest how to do this? Thanks
TOPqueries.