Archives of the TeradataForum
Message Posted: Wed, 01 Sep 2004 @ 11:45:46 GMT
Subj: | | Re: Conditionally Aborting a job |
|
From: | | teradatanewsgroup |
try the follwing (not tested code) but make sure you have stats on the row_count table - the optimiser should know that only 1 row is in
there.
select *
from table_a as a,
table_row_count as b
where 1=1 /* you don't need it but it documents that you know that you do a product join */
group by b.row_count /* is a constant */
having count(*) <> b.row_count
.if errorcode <> 0 then .exit 8
.if activitycount <> 0 then .exit 16;
--
Ulrich Arndt
www.data2knowledge.de
|