﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / SQL Server 2008 / SQL Server Newbies  / How to split query result into seperate columns / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Tue, 18 Jun 2013 18:34:27 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: How to split query result into seperate columns</title><link>http://www.sqlservercentral.com/Forums/Topic1426289-1292-1.aspx</link><description>[quote][b]Jeff Moden (3/4/2013)[/b][hr][quote][b]Sean Lange (3/4/2013)[/b][hr][quote][b]Ed Wagner (3/4/2013)[/b][hr]Thanks, Sean.  Good article.  You know, I'm consistently impressed by just how many different uses there are for the tally table.  So simple in design, yet the performance gains are through the roof.  Thanks again.[/quote]One of the regulars around here (I always forget who) once called it the "Swiss Army Knife of SQL". They were absolutely correct. The usage of something so simple is truly amazing. :cool:[/quote]That would be none other than Gianluca Sartori, the "spaghetti dba".[url]http://spaghettidba.com/[/url][/quote]Thanks for remembering Jeff. His assessment is so spot on that I often refer to it myself the same. :-P</description><pubDate>Tue, 05 Mar 2013 07:21:52 GMT</pubDate><dc:creator>Sean Lange</dc:creator></item><item><title>RE: How to split query result into seperate columns</title><link>http://www.sqlservercentral.com/Forums/Topic1426289-1292-1.aspx</link><description>Thanks Sean,The name of the function required would have been 99% help, the brilliant article with an example was the icing on the cake !!!!  totally worked for me, thanks again. :Wow:</description><pubDate>Tue, 05 Mar 2013 01:40:44 GMT</pubDate><dc:creator>brett.y</dc:creator></item><item><title>RE: How to split query result into seperate columns</title><link>http://www.sqlservercentral.com/Forums/Topic1426289-1292-1.aspx</link><description>[quote][b]Sean Lange (3/4/2013)[/b][hr][quote][b]Ed Wagner (3/4/2013)[/b][hr]Thanks, Sean.  Good article.  You know, I'm consistently impressed by just how many different uses there are for the tally table.  So simple in design, yet the performance gains are through the roof.  Thanks again.[/quote]One of the regulars around here (I always forget who) once called it the "Swiss Army Knife of SQL". They were absolutely correct. The usage of something so simple is truly amazing. :cool:[/quote]That would be none other than Gianluca Sartori, the "spaghetti dba".[url]http://spaghettidba.com/[/url]</description><pubDate>Mon, 04 Mar 2013 16:49:26 GMT</pubDate><dc:creator>Jeff Moden</dc:creator></item><item><title>RE: How to split query result into seperate columns</title><link>http://www.sqlservercentral.com/Forums/Topic1426289-1292-1.aspx</link><description>[quote][b]Ed Wagner (3/4/2013)[/b][hr]Thanks, Sean.  Good article.  You know, I'm consistently impressed by just how many different uses there are for the tally table.  So simple in design, yet the performance gains are through the roof.  Thanks again.[/quote]One of the regulars around here (I always forget who) once called it the "Swiss Army Knife of SQL". They were absolutely correct. The usage of something so simple is truly amazing. :cool:</description><pubDate>Mon, 04 Mar 2013 10:16:57 GMT</pubDate><dc:creator>Sean Lange</dc:creator></item><item><title>RE: How to split query result into seperate columns</title><link>http://www.sqlservercentral.com/Forums/Topic1426289-1292-1.aspx</link><description>Thanks, Sean.  Good article.  You know, I'm consistently impressed by just how many different uses there are for the tally table.  So simple in design, yet the performance gains are through the roof.  Thanks again.</description><pubDate>Mon, 04 Mar 2013 10:14:33 GMT</pubDate><dc:creator>Ed Wagner</dc:creator></item><item><title>RE: How to split query result into seperate columns</title><link>http://www.sqlservercentral.com/Forums/Topic1426289-1292-1.aspx</link><description>What you are referring to is called a cross tab or pivot. See the articles in my signature about those topics.</description><pubDate>Mon, 04 Mar 2013 09:01:24 GMT</pubDate><dc:creator>Sean Lange</dc:creator></item><item><title>How to split query result into seperate columns</title><link>http://www.sqlservercentral.com/Forums/Topic1426289-1292-1.aspx</link><description>I have one table that contains all my data.  I can group into a result as below (the weight would the the sum per day):[u][b]Time[/b][/u]_____________________[u][b]Plant[/b][/u] ______[u][b]Weight[/b][/u]01/03/2013 10:00___________AP1________1.202/03/2013 11:00___________AP1________2.303/03/2013 12:00 __________AP1 ________1.101/03/2013 10:00 __________AP2_________1.402/03/2013 10:00 __________AP2 ________1.103/03/2013 10:00 __________AP2_________1.1How do I go about splitting the sum(weight) up into seperate columns based on 'Plant' so the query result looks like this:[b]Time[u][/u][/b]_____________________[b]AP1[u][/u][/b]______[b]AP2 [u][/u][/b]        01/03/2013 10:00__________1.2_______1.4          02/03/2013 11:00__________2.3_______1.103/03/2013 12:00__________1.1_______1.1Basically I want to group the results into columns rather than one long result.Thanks</description><pubDate>Mon, 04 Mar 2013 08:45:16 GMT</pubDate><dc:creator>brett.y</dc:creator></item></channel></rss>