Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

coalesce

$
0
0

I have a situation here, my source table is like this

COL1COL2 COL3COL4 COL5COL6 COL7COL8 COL9COL10

12 NULL4 NULL6 NULL8 9NULL

NULLNULL NULL4 NULL6 NULLNULL NULL10

1 NULLNULLNULLNULLNULL7NULL NULLNULL

my output should be selecting first 3 non null values in 3 columns as below

OUT1OUT2 OUT3

12 4

46 10

17 NULL

is there is any way to deal with it ??


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>