Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

SQL Server 2005 for SQL2k Developer (Part 1)? Expand / Collapse
Author
Message
Posted Tuesday, February 21, 2006 2:58 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Saturday, January 11, 2014 5:30 AM
Points: 9, Visits: 25
Comments posted to this topic are about the content posted at http://www.sqlservercentral.com/columnists/mcAmri/sqlserver2005forsql2kdeveloperpart1.asp
Post #260419
Posted Wednesday, March 29, 2006 7:14 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Wednesday, August 30, 2006 11:06 AM
Points: 11, Visits: 1

Clean and clear demonstration of such a useful feature...

Thank you

Post #269366
Posted Wednesday, March 29, 2006 8:12 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Thursday, February 21, 2013 9:25 AM
Points: 43, Visits: 134
I look forward to more...thanks!


Post #269393
Posted Wednesday, March 29, 2006 8:41 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Tuesday, July 28, 2009 8:25 AM
Points: 50, Visits: 99
Thanks for the examples.  In case anyone is working through them, the case statement has a typo with a '2002' replaced with a '2001'
Post #269409
Posted Wednesday, March 29, 2006 2:02 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, August 14, 2006 10:34 AM
Points: 1, Visits: 1

Thankyou I found your article very helpful and presented in a clear style. I look forward to reading more of your work

 

Post #269588
Posted Wednesday, March 29, 2006 10:31 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Saturday, January 11, 2014 5:30 AM
Points: 9, Visits: 25
Hi Paul,

thanks for the correction of the typo.
The query still works fine, but order year 2001 will be interpreted as 2002 .

It should be like this:

SUM(CASE when OrderYear = 2002 then SubTotal ELSE 0 end) as '2002',
Post #269663
Posted Wednesday, March 29, 2006 11:28 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Tuesday, July 10, 2007 10:01 AM
Points: 19, Visits: 1
i look farward for more. thanks !


slathar
Post #269666
Posted Friday, March 31, 2006 2:52 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Saturday, January 11, 2014 5:30 AM
Points: 9, Visits: 25
Hi All,

I'm working on second installment of this series now. Just wait
Post #270051
Posted Thursday, May 11, 2006 2:53 PM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Thursday, May 1, 2014 7:26 AM
Points: 908, Visits: 2,804

Good intro. Thanks. 

I've got a question, though.  Given this statement from your article:

INSERT INTO SalesByPerson
SELECT SalesPersonID, [2002],[2003],[2004] FROM Sales.SalesSummarry
PIVOT(SUM(SubTotal) FOR OrderYear IN
([2002],[2003],[2004])) as SalesPivot

is the IN (.....) required?  What if I don't know the values and/or the values change?  Am I stuck with dynamic SQL?  Could I maybe put a sub-query (i.e. select DISTINCT OrderYear) in there?

Post #279430
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse