Results 1 to 4 of 4

Thread: SQL 2005 Pivot Command

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2005
    Posts
    259

    SQL 2005 Pivot Command

    How do I use the Pivot Command in SQL Server 2005. I have been looking at samples but I cannot Figure out what I am supposed to do with the two columns in the IN. I marked them as [...], [...] below.
    vb Code:
    1. SELECT [0], [1]
    2. FROM
    3.     SELECT     ServiceClassID, ServiceClassCode
    4.     FROM         vServiceClasses
    5. PIVOT
    6. (COUNT (ServiceClassID)
    7. FOR ServiceClassCode IN
    8. ([0], [1]
    9. ) AS pvt
    Last edited by FastEddie; Aug 17th, 2007 at 03:10 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width