From: Neil Tompkins Date: November 22 2012 5:05pm Subject: Re: Basic SELECT help List-Archive: http://lists.mysql.com/mysql/228698 Message-Id: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary=047d7b66f3c573d23604cf187ad5 --047d7b66f3c573d23604cf187ad5 Content-Type: text/plain; charset=ISO-8859-1 When trying this query I get FUNCTION id does not exist On Thu, Nov 22, 2012 at 4:46 PM, Michael Dykman wrote: > select id from > > (select distinct id, count(*) > > from my_table > > where type in (2,5) > > group by id > > having count(*) = 2)a; > --047d7b66f3c573d23604cf187ad5--