Oracle

String Aggregation Techniques (Converting Columns to Rows)

Sometimes we need to write SQL that takes column results (separated by comma) and separate them into separate rows (ie. Columns to Rows). Below are some techniques to display single column value into a multiple rows. DECLARE l_list1 VARCHAR2(50) := 'A,B,C,D,E,F,G,H,I,J'; l_list2 VARCHAR2(50); l_tablen BINARY_INTEGER; l_tab DBMS_UTILITY.uncl_array; BEGIN …
Read more