[thelist] MS SQL 2000
Casey Crookston
caseyc at IntelliSoftmn.com
Tue Aug 22 10:58:31 CDT 2006
Or... scratch that. I can just do a select distinct (everything but the
unique id) and then write it to a new tabl. That will solve the
problem.
Casey
-----Original Message-----
What I was hoping for was to return all rows that had a duplicate (not
including the unique id). If one row was repeated three times, it would
return all three rows.
Is this worth examining? Or is it too complex?
Casey
--- Original Message --
[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.
--
* * Please support the community that supports you. * *
http://evolt.org/help_support_evolt/
For unsubscribe and other options, including the Tip Harvester
and archives of thelist go to: http://lists.evolt.org
Workers of the Web, evolt !
More information about the thelist
mailing list