Home Page for the TeradataForum

Archives of the TeradataForum

Message Posted: Thu, 25 Oct 2001 @ 19:31:45 GMT

  <Prev Next>   <<First <Prev Next> Last>>  

Subj:   Re: Count Function
From:   Bethany Withers

Change the where to having. Changing the order by to 2 desc gives you the col1's with the most duplicates first. If that is of value. Ie.

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

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