I have a SQL View and i want to add an additional column to compute the value based on 2 other columsn within the same view. ie
If i have a column by the name, NOTIFICATION_STEP_ID and if it hold a value 1 or 2 or 3 then
i want to expose a new column that show the combination of 2 columns .
SELECT ID, NOTIFICATION_STEP_ID,NOTIFICATION_STEP,CREATE_DATE FROM TABLE_NAME
SELECT ID, NOTIFICATION_STEP_ID,CREATE_DATE, NEW_COLUMN FROM TABLE_NAME
the NEW_COLUMN should hold the value of CREATE_DATE + ',' + NOTIFICATION_STEP
If the NOTIFICATION_STEP_ID is not (2,3) then i need to display only NOTIFICATION_STEP
Can i use a IF ELSE CLAUSE IN A VIEW. I tried it and i am getting an error.
How can i achieve my objective. Please illustrate the view .