Quantcast
Channel: Teradata Forums - All forums
Viewing all articles
Browse latest Browse all 27759

Dynamic Column Name - forum topic by saurabhkamath

$
0
0

How can I create a view with Dynamic column name ?
column name is dependent on the current_date
 
something of this sort
 
CREATE VIEW TEMP_V
SELECT ID,ARTICLE,
CASE YEAR_MONTH
WHEN CAST(CAST(CAST(DATE AS FORMAT 'YYYYMM')AS CHAR(6))AS INT)
THEN AMOUNT
END AS 'REVENUE-'||CAST(CAST(DATE AS FORMAT 'YYYYMM')AS CHAR(6))
FROM SALES_HIST

Forums: 

Viewing all articles
Browse latest Browse all 27759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>