[thelist] MS SQL 2000

Ed McCarroll Ed at ComSimplicity.com
Mon Aug 21 15:18:46 CDT 2006


> > SELECT COUNT(`foo`) AS `duplicate` FROM `bar` GROUP BY `foo`
> > HAVING `duplicate` > 1 

1. Except if 'foo' IS NULL, where COUNT(*) might be better.

2. But does the OP want one row for each row that has a duplicate, or
   one row for each set of duplicates?
-------------------------------------------------------------------- 
Ed McCarroll                                          (310) 838-4330
Ed at ComSimplicity.com                    http://www.ComSimplicity.com



More information about the thelist mailing list