samedi 9 juillet 2016

How to show blank instead of column value for all duplicated columns of a SQL query?

There is a similar question which answer this for a known number of columns and only a single selection column. But the problem here is that I have no knowledge of columns (count, type) of a specified SQL query and also I want to blank for all columns not a single column.

For example lets say I have following query.

Select * from View1

Result :

Column(1)       Column(2)         Column(..)         Column(N)
1               A                 Sales              1500
2               C                 Sales              2500
3               C                 Sales              2500
4               A                 Development        2500

Expected result :

Column(1)       Column(2)         Column(..)         Column(N)
1               A                 Sales              1500
2               C                                    2500
3                                                        
4               A                 Development            

Pseudo SQL Query :

EXEC proc_blank_query_result 'Select * from View1'

Aucun commentaire:

Enregistrer un commentaire