[thelist] simple sql question

Joe Ngo chilijoe at gmail.com
Fri Nov 24 23:19:59 CST 2006


On 11/25/06, Joe Ngo <chilijoe at gmail.com> wrote:
>
>
> DELETE FROM files
> Where fileid NOT IN
> (SELECT min(fileid) FROM files
> GROUP BY title HAVING count(*) >1)
>
> I goofed. Hoped you haven't tried that yet. It will also delete titles
that don't have duplicates. Should be:

DELETE FROM files
Where fileid NOT IN
(SELECT min(fileid) FROM files
GROUP BY title)

-- 
http://xtrahot.chili-mango.net
There's still no place like ~



More information about the thelist mailing list