|
|
Archives of the TeradataForum
Message Posted: Wed, 14 Dec 2011 @ 20:44:00 GMT
Subj: | | Re: Insert load half of my data |
|
From: | | Issah, Gabriel |
I am using Teradata assistance and my query is straight forward
iNSERT INTO T_Test.Ac_In
( Segmt_Id, Unit_Id, Acct_Id, , Lmt_Acum_Cd, Lmt_Acum_Desc)
SELECT DISTINCT
T3.SEGMT_ID ,
T3.UNIT_ID ,
T3.Acct_ID ,
T1.ACIN1 AS Lmt_Acum_Cd,
CASE T1.ACIN1
WHEN T1.ACIN1 THEN T1.ACIN2
WHEN T1.ACIN2 THEN T1.ACIN3
WHEN T1.ACIN3 THEN T1.ACIN4
ELSE T1.ACIN3
END AS Lmt_Acum_Desc
FROM
((Stg_BT.Stg_AccFd T1 INNER JOIN T_Test.Acct T2
ON
T1.InvNum = T2.Mem_NUM )
INNER JOIN T_Test.unit T3
ON
T2.Inv_ID = T3.Inv_ID )
WHERE
T1.prodname = T3.prodname AND
T1.recID IS NOT NULL
Thanks
Gabriel Issah
| |