Skip to content
Advertisement

How to merge two result columns into column with alternating results in oracle?

For a table with columns A and B, select * from table will give back

A        B
A1      B1
A2      B2
A3      B3

Is there a way to query on this so that the result set is like this โ€“

Merged
A1
B1
A2
B2
A3
B3

Appreciate any suggestions ๐Ÿ™‚

Advertisement

Answer

A union with some added spice to determine ordering would work:

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement