Darren Sweeney wrote:
> I have a table which has a simple field: name
> This field may contain the same name many times.
> What i need to do is to count how many distinct names there are and how many times
> their name is listed to produce something like:
> name | count
> john | 10
> Ted | 15
> Pat | 15
> etc. etc.
> I am struggling to be able to find the correct select formula ... i think i am
> looking too deeply as i am sure it is quite simple ...
> I am trying:
> select distinct name as name, count(distinct name) as count from tablename;
> Thanks for any help
select name, count(*) form table_name group by name
give you the results you are looking for?