I just want to know if it is possible to assign dynamic names to a column. for instance:
SQL> select sysdate+1 from dual;
SYSDATE+1
---------
09-JUL-08
the column name is SYSDATE+1. can I do something like:
SQL> select 1 as (select sysdate from dual) from dual;
(this throws error)
The reason for this requirement is that I need to assign a column name according to a value that comes from a parameter. So, instead of returning something like:
SQL> select sysdate, sysdate+1 from dual;
SYSDATE SYSDATE+1
--------- ---------
08-JUL-08 09-JUL-08
I need to find a way to return something like:
SQL> select sysdate as <<dynamic column name based on parameter that has been passed in>>, sysdate+1 AS <<dynamic column name based on parameter that has been passed in>> from dual;
Obviously I can use something like:
select sysdate as "08-JUL-08", sysdate+1 AS "09-JUL-08" from dual;
But in this case I'm hard coding it. I need this alias to be dynamic.
Any way to do it?