Yes! I want the number of distinct names. None of the earlier queries give me
what I'm looking for. I want the number of distinct names in the same way as
a 'select count(*) from names' would, exept that would give me all the
entries (count the same name multiple times).
Paul DuBois wrote:
> I thought he wanted the number of distinct names, not the number of
> instances of each distinct name?
>
> At 2:11 AM +0000 5/1/1999, jkraai wrote:
> >Drop the distinct:
> > SELECT lastname, count(*)
> > FROM names
> > GROUP BY lastname
> >will give you all distinct last names and their counts
> >
> >--jim
> >
> >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.
>
> --
> Paul DuBois, paul@stripped
> Northern League Chronicles: http://www.snake.net/nl/
>
> ---------------------------------------------------------------------
> Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
> posting. To request this thread, e-mail mysql-thread2723@stripped
>
> To unsubscribe, send a message to the address shown in the
> List-Unsubscribe header of this message. If you cannot see it,
> e-mail mysql-unsubscribe@stripped instead.
--
Mike Machado
mike@stripped
InnerCite
Network Specialist