On 15-Aug-2001 Stephen VanDyke wrote:
> Ok here's the current method I'm using to find non-distinct records in a
> table:
> 
> 1) SELECT DISTINCT column1 FROM table WHERE column2='something'
> 
> 2) I get an array and mash it together [PHP: $biglist =
> "'".implode("','",$column)."'";]
> 
> 3) SELECT column1 FROM table WHERE column1 NOT IN($biglist);
> 
> now the question I have is this... is it possible to somehow blow away steps
> 2/3 and start off by selecting NOT DISTINCT? I read from
> http://www.mysql.com/doc/D/I/DISTINCT_optimization.html that MySQL uses a
> GROUP to find distinct records, so I'm guessing this is something that would
> be very difficult to do normally.
> 

Incredibly difficult.

select foo,count(*) as cnt from da_table group by foo having cnt >1;

Regards,
-- 
Don Read                                       [EMAIL PROTECTED]
-- It's always darkest before the dawn. So if you are going to 
   steal the neighbor's newspaper, that's the time to do it.
                            (53kr33t w0rdz: sql table query)

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to