![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
|
I'm running counts against a table with 15,467,245 rows. When I run a count on a table using distinct(id) I get the following results: select count(distinct(id)) from emp; ------------------------------------ 15,254,678 15,467,245 - 15,254,678 = 312,567 duplicates (easy right) |
|
However, when I try to pull off the duplicates with the having count(*). I get a different set of numbers: select count(*) from (select (account_id from emp having count(*) > 1 group by account_id); ------------------------------------- 302,831 duplicates |
![]() |
| Thread Tools | |
| Display Modes | |
| |