Hi,
since column names (or table names) are not first-class values in SQL, computing such names at query runtime is impossible.
Best wishes,
—Torsten
On Thu, Nov 11, 2021, at 08:46, aditya desai wrote:
Hi,
I want to construct column name alias by using different queries. E.g. below.
postgres=# Select ('Status as on '||date_part('day', (SELECT current_timestamp))||'th '||TO_CHAR(current_timestamp, 'Mon'))
postgres-# ;
?column?
-----------------------
Status as on 11th Nov
" Status as on 11th Nov" should be my column name in a query.
SELECT JoiningDate as "Status as on 11th Nov" from empdetails;
How can I achieve this?
Regards,
Aditya.