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

One Row into multiple Column

$
0
0

CREATE TABLE #ids (empid VARCHAR(200))

INSERT INTO #ids SELECT '100,200,300,400'
INSERT INTO #ids SELECT '1100,1200,1300,1400'


 
I am trying to get output following format

ID_1    ID_2   ID_3  ID_4

100     200    300   400
1000    1200   1300  1400
----
----

Each row in EmpId column will have only max. four values

Thanks

V


Viewing all articles
Browse latest Browse all 23857

Trending Articles



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