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

Tearadata SQL Help - Very much Urgent - response (2) by Qaisar Aftab Kiani

$
0
0
You can UNION multiple SELECT statements to transform the results from rows into columns like Considering PROD_LVL_NM is a unique random value generated against each row... SELECT KEY, ROW_NUMBER() OVER(ORDER BY KEY) AS PROD_LVL_NM, PROD_CODE FROM ( SELECT KEY, OA_PRODUCT_1 AS PROD_CODE FROM TBL UNION ALL SELECT KEY, OA_PRODUCT_2 AS PROD_CODE FROM TBL --AND SO ON ) T 

Viewing all articles
Browse latest Browse all 27759

Trending Articles



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