question

sawper avatar image
sawper asked

How to select multi row in one row?

Hi please help me to do this on multi row select when sort of row is'nt continued: col1 1 2 3 6 7 9 10 after select : 1,2,3 6,7 9,10
selectsortingestimated rows
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
JohnM avatar image
JohnM answered
If you have multiple rows that you want to return as columns, you'll need to look at the PIVOT/UNPIVOT commands. PIVOT will turn rows into columns and UNPIVOT will turn columns back into rows. Resource: https://technet.microsoft.com/en-us/library/ms177410%28v=sql.105%29.aspx Hope that helps!
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.