Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Please help me put this in a pivot selection??? Using SQL 2005

Please help me put this in a pivot selection??? Using SQL 2005

Scheduled Pinned Locked Moved Database
databasehelptutorialquestion
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Support123
    wrote on last edited by
    #1

    Hi all, i have the following... SELECT Distinct DocGroup.Owner , DocGroup1.Document_Group as Grp1, DocGroup2.Document_Group as Grp2, DocGroup3.Document_Group as Grp3, DocGroup4.Document_Group as Grp4, DocGroup5.Document_Group as Grp5, DocGroup6.Document_Group as Grp6, DocGroup7.Document_Group as Grp7, DocGroup8.Document_Group as Grp8, DocGroup9.Document_Group as Grp9, DocGroup10.Document_Group as Grp10, DocGroup11.Document_Group as Grp11, DocGroup12.Document_Group as Grp12, DocGroup13.Document_Group as Grp13, DocGroup14.Document_Group as Grp14, DocGroup15.Document_Group as Grp15, DocGroup16.Document_Group as Grp16 FROM Document DocGroup LEFT JOIN Document DocGroup1 ON DocGroup.Owner = DocGroup1.Owner AND DocGroup1.Document_Group = '1' LEFT JOIN Document DocGroup2 ON DocGroup.Owner = DocGroup2.Owner AND DocGroup2.Document_Group = '2' LEFT JOIN Document DocGroup3 ON DocGroup.Owner = DocGroup3.Owner AND DocGroup3.Document_Group = '3' LEFT JOIN Document DocGroup4 ON DocGroup.Owner = DocGroup4.Owner AND DocGroup4.Document_Group = '4' LEFT JOIN Document DocGroup5 ON DocGroup.Owner = DocGroup5.Owner AND DocGroup5.Document_Group = '5' LEFT JOIN Document DocGroup6 ON DocGroup.Owner = DocGroup6.Owner AND DocGroup6.Document_Group = '6' LEFT JOIN Document DocGroup7 ON DocGroup.Owner = DocGroup7.Owner AND DocGroup7.Document_Group = '7' LEFT JOIN Document DocGroup8 ON DocGroup.Owner = DocGroup8.Owner AND DocGroup8.Document_Group = '8' LEFT JOIN Document DocGroup9 ON DocGroup.Owner = DocGroup9.Owner AND DocGroup9.Document_Group = '9' LEFT JOIN Document DocGroup10 ON DocGroup.Owner = DocGroup10.Owner AND DocGroup10.Document_Group = '10' LEFT JOIN Document DocGroup11 ON DocGroup.Owner = DocGroup11.Owner AND DocGroup11.Document_Group = '11' LEFT JOIN Document DocGroup12 ON DocGroup.Owner = DocGroup12.Owner AND DocGroup12.Document_Group = '12' LEFT JOIN Document DocGroup13 ON DocGroup.Owner = DocGroup13.Owner AND DocGroup13.Document_Group = '13' LEFT JOIN Document DocGroup14 ON DocGroup.Owner = DocGroup14.Owner AND DocGroup14.Document_Group = '14' LEFT JOIN Document DocGroup15 ON DocGroup.Owner = DocGroup15.Owner AND DocGroup15.Document_Group = '15' LEFT JOIN Document DocGroup16 ON DocGroup.Owner = DocGroup16.Owner AND DocGroup16.Document_Group = '16' This is taking 4ever to load... would it help to put this in a pivot table?? i have been trying but i cant seem to do it (i only have an example of where count is used in a pivot table??) Thank you in advance.

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups