I'm having some trouble with formatting so hopefully my description makes sense. I am writing a query for an Oracle DB that doesn't support the Pivot function, but I have used Decode in the past to achieve a similar result.
The query so far returns a table of 2 columns, the first is a text label, the second is an item number. Every row will contain a label and an item number, the item numbers will each be unique but the labels will repeat.
For example
A - 101
B - 102
A - 103
C - 104
B - 105
A - 106
I would like to pivot this so I have one row for each text label and as many columns as necessary to show all the matching item numbers. So the table would look like
A - 101 - 103 - 106
B - 102 - 105
C - 104
The quantity of numbers that need to be pivotted is variable, as are the item numbers themselves. Is this possible to do using the decode function, or any other function?