Question:
Is it possible to have a column name in a select statement changed based on a value in it's result set?
For example, if a "year" value in a result set is less than 1950, name the column "OldYear", otherwise name the column "NewYear." The year value in the result set is guaranteed to be the same for all records.
I'm thinking this is impossible, but here was my failed attempt to test the idea:
select 1 as
(case
when 2 = 1 then "name1";
when 1 = 1 then "name2")
from dual;