January 17, 2012 at 12:30 pm
Hi Folks
i am sure someone has already answered this one, but i cannot seem to find any info
if my output is the folowing:
test1 0
test1 1
test1 2
test2 0
test2 1
test2 2
test3 0
test3 1
test3 2
how can i get it to output in this format (if possible in t-sql)
Thanks
Jim
test1
0
1
2
test2
0
1
2
test3
0
1
2
January 17, 2012 at 12:37 pm
Ideally that type of formatting should be done in the front end. What you have as desired output is really tough because you want to turn 3 rows of data into 4 rows of output. If you absolutely have to format this in sql please post some ddl and sample data and we can take a shot at it.
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
January 17, 2012 at 12:39 pm
Thanks Sean
not important enough to spend time
just asking
Jim
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply