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

volatile table as select..with data - not loading data - response (19) by Adharssh

$
0
0

Hi,

 
From what i see and understood from the query is that You want to Join the Temp1 table & SOmetable with date. Please find the modified query, You are selecting 2 columns from the SOmetable and trying to insert only one to the temp1 table.

Insert into Temp1(temp_1.Q1Count)

SEL  someTable.Q1Count FROM 
(
SELECT CAST(RP.REGIS_DATETM AS DATE) AS MyDate,
                        COUNT(DISTINCT RP.REGIS_PRSNA_ID) AS Q1Count
                FROM
                        iCRM_LOAD.REGIS_PRSNA RP
                        INNER JOIN iCRM.MKTNG_PGM MP
                            ON RP.MKTNG_PGM_NBR = MP.MKTNG_PGM_NBR
                        INNER JOIN iCRM.REGIS_PRSNA_EMAIL_ADDR RPE
                            ON RP.REGIS_PRSNA_ID = RPE.REGIS_PRSNA_ID
                                AND RP.MKTNG_PGM_NBR = RPE.MKTNG_PGM_NBR
                WHERE
                        RP.MKTNG_PGM_NBR IN (115)
                        AND RPE.SUBSCRPTN_OPT_IND = 'I'
                        AND RP.PRSNA_STATUS_CODE = 'AC'
                        AND RP.REGIS_DATETM BETWEEN (CURRENT_DATE -7) and CURRENT_DATE                          
                GROUP BY CAST (RP.REGIS_DATETM AS DATE)
) someTable 
 
INNER JOIN Temp1
ON
Temp1.Date= SomeTable.Date;

Thanks & Regards,
Adharssh.


Viewing all articles
Browse latest Browse all 14773

Trending Articles



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