SQL Language (MOSC)

MOSC Banner

Convert Rows to Columns

I am using database 19c (19.10.0.0.0) I have a requirement to transpose rows to columns returned by query. Requirement is to generate dynamic columns for a report where I don't know exact no. of columns (which are actually rows)

For example, I have following rows of item code

A

B

C

D

I need to convert like below

A B C D

I used listagg function to convert rows to single column but I am not getting idea how to break in columns. Any help or idea will be highly appreciated.

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center