I need to set alias to a column name as current_date in the format (DDMMMYYYY) in a select query (Teradata version 14).
Eg: Select case when ... then
end as current_date
This is standard in teradata to eclose key words in double qoutes if you want to use them as Alias. I have tested and it works fine on SQLA.
Which query tool are you using?
Yes, it works fine. You will just need to enclose the Alias in double quotes:
CASE WHEN ... THEN 1
END AS "CURRENT_DATE"
I tried the same
max((case order_dt when cast ((cast(current_date -9 as format 'ddmmmyyyy')) as char(9)) then "seq" else null end)) as "current_date",
and this is the output
I am using Teradata SQL Assistant (V 14.1)