Skip to content

Instantly share code, notes, and snippets.

@tsundara
Last active January 24, 2017 21:19
Show Gist options
  • Save tsundara/f259cc68a26e25f3ef505fafbd54b913 to your computer and use it in GitHub Desktop.
Save tsundara/f259cc68a26e25f3ef505fafbd54b913 to your computer and use it in GitHub Desktop.
Oracle - Get Oracle column names separated by comma
--Straighforward table_name and corresponding column names
SELECT table_name, LISTAGG(column_name, ',') WITHIN GROUP (ORDER BY column_name) as COLUMNS
FROM user_tab_cols
group by table_name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment