For Exapmle
There is table test
| id | col1 | col2 | col3 | col4 |
| 1 | NULL | NULL | W | M |
| 2 | Q | NULL | R | NULL |
| 3 | NULL | W | P | T |
| 4 | NULL | NULL | NULL | S |
Now I want to get the result like that in a single column
First Not NULL Values
W
Q
W
S
So what you think how can we get that,
First thing is that you can use cursor and loop each row and get them.
The second one is the use of COALESCE to get that
this query will get the result
SELECT COALESCE(col1,col2,colo3,col4) FROM TEST
If you have any query you can ask me at matespoint@gmail.com