Archives of the TeradataForum
Message Posted: Fri, 02 Jan 2009 @ 14:32:03 GMT
it's not elegant but this should work
select sum(counts) total_number from ( select column1, count (*) as counts from tablename1 inner join (select column1 from tablename2 where condition group by 1) as tablename2 on tablename1.column1 = tablename2.column1 group by 1 ) tablename3
Note: the group by in the derived table is related for avoiding double countings (in case you have)
Hope this helps.
|Copyright 2016 - All Rights Reserved|
|Last Modified: 27 Dec 2016|