Listagg function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Getting list of columns per table | |
SELECT table_name, | |
LISTAGG(column_name, ', ' | |
ON OVERFLOW TRUNCATE | |
'... with more column(s) ' | |
WITH COUNT | |
) WITHIN GROUP | |
(ORDER BY column_id) AS columns | |
FROM all_tab_columns | |
GROUP BY table_name; | |
TABLE_NAME COLUMNS -- If too many columns... | |
-------------- -------------------------------------------------- | |
CUSTOMERS CUSTOMER_ID, FIRST_NAME, LAST_NAME, SECRET_NAME | |
GREEK_TEMPLE […], HEIGHT, WEIGHT, ... with more column(s) (8) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment