From: Don Read Date: May 1 1999 2:13am Subject: RE: DISTINCT and COUNT() SQL Query List-Archive: http://lists.mysql.com/mysql/2720 Message-Id: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit On 01-May-99 Mike Machado wrote: > I am trying to find a query that would select the distinct names in a > field and return the number. I know select distinct lastname from names > will return the distinct list and have the total at the bottom, but > I would like to use the COUNT() as part of this. Something like select > distinct lastname, count(*) as c from names group by s, but this is not > working. Can anyone come up with a statement to do this? Thanks. > select distinct lastnames,count(lastname) from whatever group by s Regards, --- Don Read sysop@stripped EDP Manager dread@stripped Calcasieu Lumber Co. Austin TX -- Meddle not in the affairs of dragons, for you are crunchy and taste good with ketchup.