I have a table like this:
ID CODE
----------------------
1111 HE
1111 HO
1111 FR
2222 CH
2222 AA
2222 LM
2222 BB
3333 HO
3333 FR
and I want to return 1 row per id with 4 columns per row
I've read about dynamic SQL but have not used it before. As the number of columns is defined is a dynamic query required? Also will dynamic queries work within PL/SQL?
Expected:
ID CODE_1 CODE_2 CODE_3 CODE_4
--------------------------------------------------
1111 HE HO FR NULL
2222 CH AA LM BB
3333 HO FR NULL NULL