Igor, Which of those would be fastest? Or don't you have enough information to tell?
RobR -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Igor Tandetnik Sent: Monday, August 06, 2012 9:14 AM To: [email protected] Subject: Re: [sqlite] Select rows where a column is not unique Tilsley, Jerry M. <[email protected]> wrote: > I'm sure this is a pretty lame question, but my thinking hat is > malfunctioning this morning. How can I select all rows from a table where a > specific column is NOT UNIQUE? select * from MyTable where SpecificColumn in ( select SpecificColumn from MyTable group by SpecificColumn having count(*) > 1); -- or select * from MyTable t1 where exists ( select 1 from MyTable t2 where t2.SpecificColumn = t1.SpecificColumn and t2.rowid != t1.rowid); -- or select * from MyTable t1 where 1 < ( select count(*) from MyTable t2 where t2.SpecificColumn = t1.SpecificColumn); -- Igor Tandetnik _______________________________________________ sqlite-users mailing list [email protected] http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users _______________________________________________ sqlite-users mailing list [email protected] http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

