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

convert rows ro collumns

$
0
0

I have this data, where number of rows can be different:

select '' col1 union  allselect 'asd'   union  allselect 'gfrf2'   union  allselect '2_44ff'   union  allselect 'ae6754'   union  allselect 'fff'   union  allselect 'zzzz'  order by 1

Need to get this result:

select '', '2_44ff','ae6754','asd','fff','gfrf2','zzzz'


Viewing all articles
Browse latest Browse all 23857

Trending Articles



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