ROw to column conversion query

  • Hi Gurus,

    Can anyone plz help with a query to disply rows in column, below is the sceniro.

    I have table conating two fields 'Process' and 'Dep'

    ProcessDep

    process1 Dep1

    process1 Dep1

    process1 Dep2

    process1 Dep3

    process2 Dep1

    process2 Dep1

    process2 Dep3

    I need a query for out put which looks like below

    ProcessDepDepDep

    Process1 Dep1Dep2 Dep3

    Process2 Dep1Dep3

    Thanks in advance

  • Hi

    Cant write the query now.. bit busy. You can do this using CASE statements. Check this site for more details and examples.

    "Keep Trying"

  • check out my post "UnPivot"... same concept, you just won't need the cross join and you'll use seperate CASE statements instead of 1 big one...

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply