Hi, Is it possible to create a dynamic alias name based upon a field value?
For exp:
Select id,
case when month=1 then cnt_of_tkts end as month
,case when month=2 then cnt_of_tkts end as month
,case when month=3 then cnt_of_tkts end as month
from
mytable;
Here month is a column name of a table and I would like its value (01,02,03) to be column headings of my query: Result
id 01 02 03
1001 15 10 11
Thanks for your help.
For exp:
Select id,
case when month=1 then cnt_of_tkts end as month
,case when month=2 then cnt_of_tkts end as month
,case when month=3 then cnt_of_tkts end as month
from
mytable;
Here month is a column name of a table and I would like its value (01,02,03) to be column headings of my query: Result
id 01 02 03
1001 15 10 11
Thanks for your help.