Home Page for the TeradataForum

Archives of the TeradataForum

Message Posted: Thu, 25 Oct 2001 @ 19:17:01 GMT

  <Prev Next>  
Next> Last>>  

Subj:   Count Function
From:   Williams Heartsill

I have been given a database to make sense from (well, at least determine the relationships). In one particulare table, the composite key contains a sequence number that is distinct in 90% of the cases. To help determine how the data relates to other tables, I would like to be able to select just the 10% of sequence numbers that are not distinct for further study.

I would like to run the following query:

select col1 , count(seq_nbr)
from databasename.tablename
where count(seq_nbr) > 1
group by 1
order by 1 ;

However, the message returned is "3569: Improper use of an aggregate function in a WHERE Clause."

Do any of you know of a subquery or other function that would list just the multiple instances of seq_nbr?



  <Prev Next>  
Next> Last>>  
  Top Home Privacy Feedback  
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 28 Jun 2020