How to fetch only not null columns from a table in sql server ?
For Example : Let us think there are 3 columns x1, x2 and x3 with 10 records.
If all the 10 record values of x3 column are null, Then I dont want to display that column. Only x1 and x2 needs to gets displayed.
I dont want to go for looping technique.


Salman BegRank #284 · 8.8K reputationPosted Feb 10, 2019, 10:27 PM EST
Puneet KankarRank #446 · 5.6K reputationPosted Feb 10, 2019, 9:09 PM EST
Amit GuptaRank #190 · 12.8K reputationPosted Feb 10, 2019, 9:18 PM EST
Packiaraj SanthiyaguRank #659 · 3.6K reputationPosted Feb 10, 2019, 10:30 PM EST