Could anyone tell me how I would transform multiple rows into multiple columns in oracle, assuming that i did NOT know the total number of outgoing columns (i.e. it's flexible).
So turning a list like this:
NAME OCCUPATION
MATT BUILDER
JEFF BUILDER
GEORGE BUILDER
CHRIS PLUMBER
JOHN PLUMBER
...into:
OCCUPATION NAME1 NAME2 NAME3
BUILDER MATT JEFF GEORGE
PLUMBER CHRIS JOHN [NULL]
Any help much appreciated! Can this be done with a single SQL query?
Regards
Matt
So turning a list like this:
NAME OCCUPATION
MATT BUILDER
JEFF BUILDER
GEORGE BUILDER
CHRIS PLUMBER
JOHN PLUMBER
...into:
OCCUPATION NAME1 NAME2 NAME3
BUILDER MATT JEFF GEORGE
PLUMBER CHRIS JOHN [NULL]
Any help much appreciated! Can this be done with a single SQL query?
Regards
Matt