Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2004
    Posts
    3

    Exclamation Unanswered: URGENT plz ! Pivot rows to columns in SQL Server 2000

    Hi,

    I have the following data in a table called "Products" :

    Product Qty LHinging RHinging
    -------- ----- -------- --------
    Panel_1 1 R
    Panel_1 1 L
    Panel_1 1 R
    Panel_1 1 R
    Panel_2 1
    Panel_2 1 L


    I need to group this data like this :

    Product Qty LHinging RHinging
    -------- ----- -------- --------
    Panel_1 3 L R
    Panel_2 1
    Panel_2 1 L


    How can I do that ???

    Thanks !

  2. #2
    Join Date
    May 2007
    Location
    Belfast, N.I
    Posts
    3

  3. #3
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    You show four columns in your schema, but only three columns in your recordset:
    Code:
    Product Qty LHinging RHinging
    -------- ----- -------- --------
    Panel_1 1 R
    Panel_1 1 L 
    Panel_1 1 R
    Panel_1 1 R
    Panel_2 1 
    Panel_2 1 L
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  4. #4
    Join Date
    Jun 2004
    Posts
    3
    Thank you for your quick response.

    The problem I have is the pivot field is not a numeric data type : it's a varchar field so I can't SUM on this field.

Posting Permissions

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