|
Archives of the TeradataForumMessage Posted: Fri, 02 Jan 2009 @ 14:32:03 GMT
Hi Shijo, 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. Regards Joerg
| ||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||
Copyright 2016 - All Rights Reserved | ||||||||||||||||||||||||||||||||||||||||||||||||
Last Modified: 15 Jun 2023 | ||||||||||||||||||||||||||||||||||||||||||||||||