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

How to get this result

$
0
0

I want to get result as c1,c2,c3 by modifying the below Query

WITH CTE AS
(
Select
'c1' As A, NULL as B, Null as C
UNION ALL
SELECT
NULL, 'c2',NULL
Union ALL
SELECT
NULL, Null, 'c3'
)
SELECT * FROM CTE

Please Help me to achieve   c1 as A c2 as B c3 as C by eliminating all nulls. 

 

At present if I execute the result is as below : 


Viewing all articles
Browse latest Browse all 23857

Trending Articles



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