Re: Count of distinct records

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Thu, 09 Dec 1999 13:10:28 -0500
Message-ID: <b4sv4sckcqvjp93fri8es1e14jgrqk4hcr_at_4ax.com>


A copy of this was sent to "Pete Kolton" <peter.kolton_at_nspmbtinternet.com> (if that email address didn't require changing) On Thu, 9 Dec 1999 15:14:42 -0000, you wrote:

>We have a table which contains duplicate records.
>
>Obviously we can do a select count(*)... of the records in the table, and we
>can do a select distinct *... of the records in the table.
>
>What we want to do is combine these two so that we get a count of the
>distinct records.
>
>Any suggestions?
>
>
>

one way is:

tkyte_at_8i> select count(*) from ( select distinct * from emp );

-- 
See http://osi.oracle.com/~tkyte/ for my columns 'Digging-in to Oracle8i'...
Current article is "Part I of V, Autonomous Transactions" updated June 21'st
 
Thomas Kyte                   tkyte_at_us.oracle.com
Oracle Service Industries     Reston, VA   USA

Opinions are mine and do not necessarily reflect those of Oracle Corporation
Received on Thu Dec 09 1999 - 19:10:28 CET

Original text of this message