[thelist] MS SQL 2000
Jay Blanchard
jblanchard at pocket.com
Mon Aug 21 15:24:01 CDT 2006
[snip]
> > SELECT COUNT(`foo`) AS `duplicate` FROM `bar` GROUP BY `foo`
> > HAVING `duplicate` > 1
1. Except if 'foo' IS NULL, where COUNT(*) might be better.
[/snip]
True, it was just a starting point. If the OP wants entire records this
query is going to get quite complex.
[snip]
2. But does the OP want one row for each row that has a duplicate, or
one row for each set of duplicates?
[/snip]
My impression was that the OP wants one unique row, regardless of the
number of duplicates.
More information about the thelist
mailing list