From: Martijn Tonies Date: June 15 2004 7:20am Subject: Re: How to COUNT rows when they have a COUNT in them List-Archive: http://lists.mysql.com/mysql/167279 Message-Id: <011501c452a9$463c63d0$0a02a8c0@martijn> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Just a note... > Thanks - this did not work for me as I am on 4.0.17 - presumably this works > on 4.1 (seems to need the SubQuery feature)? If so I will upgrade > immediately! This isn't a subquery -- this is a Derived Table. With regards, Martijn Tonies Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL Server. Upscene Productions http://www.upscene.com > >Following query does what you want: > > > >SELECT COUNT(*) from (SELECT COUNT(*) as c FROM pet GROUP BY owner HAVING > >c>1) as temp > > > >-Yayati