I am trying to pivot a table but I don't want to use IN keywork because I want the data dynamic. Because when I use in clause data come in 1 column, I want to see it seperate columns. In other words, I want pivot to use IN clause be dynamic rather than hard-coded values. Is this possible?
select * from (
select 'id'||rownum ids, T.KEFILKOD from GNL_TEMINATLAR T WHERE T.TEMINATKOD = 71 AND T.MUSTERIKOD = '440'
) pivot (
max(kefilkod) for ids in ('id') ==> I don't want to use it
);
I read the following thread but Solomon (By the way he is the LEGEND) use for XML
Pivot Command, can the IN clause be dynamic rather than hard-coded values?
Should I craete pipelined table function? Does anyone know the source code of PIVOT table function in the following article?
https://technology.amis.nl/2006/05/24/dynamic-sql-pivoting-stealing-antons-thunder/
Thanks