Member since
03-15-2017
6
Posts
1
Kudos Received
0
Solutions
10-12-2017
09:09 PM
CREATE TEMPORARY TABLE T1 as select a11.D_ID D_ID, count(distinct a11.START_DT) WJXBFS1 from poc.TBL_VIEWING a11 join poc.D_TASK a12 on 0 = 0 and (a11.SAMPLE_ID = a12.SAMPLE_ID and a11.TASK_ID = a12.TASK_ID) where a11.SOURCE_ID = 1 and a11.TYPE_ID = 1 and a12.SAMPLE_DESCR in ('test') and a11.WEEK_ID in (201729,201730,201731, 201732, 201733, 201734, 201735, 201736,201737,201738) group by a11.D_ID; CREATE TEMPORARY TABLE T2 as select pa11.D_ID D_ID, pa11.WJXBFS1 DA757 from T1 pa11; CREATE TEMPORARY TABLE T3 as select a12.DA757 DA757, count(distinct a12.D_ID) WJXBFS1 from TZZ72EH3MMQ001 a12 group by a12.DA757; CREATE TEMPORARY TABLE T4 as select a11.D_ID D_ID, count(distinct a11.START_DT) WJXBFS1 from poc.TBL_VIEWING a11 join T2 a13 on (a11.D_ID = a13.D_ID) join poc.D_TASK a14 on 0 = 0 and (a11.SAMPLE_ID = a14.SAMPLE_ID and a11.TASK_ID = a14.TASK_ID) join poc.D_PROGRAM a15 on (a11.PROGRAM_ID = a15.PROGRAM_ID) where a11.SOURCE_ID = 1 and a11.TYPE_ID = 1 and a11.WEEK_ID in (201729,201730,201731,201732,201733,201734,201735,201736,201737,201738) and a14.SAMPLE_DESCR in ('test') and a15.TITLE in ('World') group by a11.D_ID;
... View more