Quantcast
Channel: Teradata Forums - Database
Viewing all articles
Browse latest Browse all 14773

Case When Statement in Teradata - response (16) by ismaildreams

$
0
0
SELECT NET_MUMD_AMT, (CASE when MKUP_MKDN_RSN_CD=26 THEN NET_MUMD_AMT AS BUYER_MKDN_PRICE_CHANGE_AMT END), (CASE WHEN MKUP_MKDN_RSN_CD=25 THEN NET_MUMD_AMT AS BUYER_MKDN_PRICE_CHANGE_AMT END), (CASE WHEN MKUP_MKDN_RSN_CD=27 THEN NET_MUMD_AMT AS BUYER_MKDN_CLEARANCE_AMT END), (CASE WHEN MKUP_MKDN_RSN_CD=9 THEN NET_MUMD_AMT AS BUYER_MKDN_HD_COUPONS_AMT END), (CASE WHEN MKUP_MKDN_TYP_CD=8 THEN  NET_MUMD_AMT AS TOTAL_BUYER_MKDN_AMT END), (CASE WHEN MKUP_MKDN_TYP_CD =4 THEN NET_MUMD_AMT AS TOTAL_MKUP_AMT END ) FROM QA_US_FINANCE_VIEWS.STR_ITEM_A_MUMD_W INNER JOIN select DISTINCT A.ITEM_SKU_NBR,B.LOC_NBR AS STORE_NBR,D.FSCL_PRD_KEY_VAL as fscl_wk_nbr, C.NET_MUMD_AMT,C.MKUP_MKDN_RSN_CD from QA_US_FINANCE_VIEWS.STR_ITEM_A_MUMD_W C LEFT OUTER JOIN QA_SHRD_VIEWS.LOC_HIER B ON C.STR_LOC_ID=B.LOC_ID LEFT OUTER JOIN QA_SHRD_VIEWS.ITEM_HIER A ON C.ITEM_ID=A.ITEM_ID LEFT OUTER JOIN QA_SHRD_VIEWS.FSCL_WK_HIER D ON C.FSCL_WK_END_DT=D.FSCL_WK_END_DT sample 5     one column mapped to different column from source to target how can i test is it right else pls tell me solution  

Viewing all articles
Browse latest Browse all 14773

Trending Articles



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