I suggest:

    select count(*)
    from table your_table_name
    group by team
    ;

The MySQL documentation at www.mysql.com certainly contains good
documentation regarding the "group by" clause within it.  However,
it doesn't really provide a motivation for using it... nor should
it.  It is documentation regarding how MySQL implements SQL and
RDMS in general, and not a general SQL tutorial or reference.

I suggest you look a bit further afield for this kind of material.
I got started with this stuff back oh 5-6 years ago with "Teach Yourself
Transact-SQL in 21 Days".  (I was working with MS SQL Server 6.5 at 
the time.)  It did a pretty good job at handling this kind of topic
(group by), "having" clause, joins, cross-tab reports, etc.  (It also
did views, stored procedures, batch programming... all sorts of stuff
I hope MySQL has one of these days. :-) )

I'm not saying that this is the book that you should get.  But if
you want to increase your SQL knowledge, you should look into getting
something.

Cheers,
Richard

> From: "Jamie Burns" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Friday, September 14, 2001 9:08 AM
> Subject: surely an easy quick one
> 
> > Hello again :o)
> >
> > This is surely an easy quick one but my brain wont work!
> >
> > I have a table (ref, name, team, seminar_ref) like:
> >
> >     1    bill    support    100
> >     2    bill    support    101
> >     3    bill    support    102
> >     4    ben  development  201
> >     5    ben  development  103
> >     6    ben  development  204
> >     7    bob  support     104
> >     8    bob  support    102
> >     9    bob  support    107
> >     7    pat   support     102
> >     8    pat   support     202
> >     9    pat   support     105
> >
> > I need to get a count of how many individual people are in the table, that
> > belong to a certain group. So if I wanted to find all individual people in
> > support the answer in this case it would be 3 (bill, bob and pat). I dont
> > need their names, just the count.

-- 
----------------------------------------------------------------------------
 Richard Dice
 ShadNet Creator * http://shadnet.shad.ca/ * [EMAIL PROTECTED]
 Occasional Writer, HotWired * http://www.hotwired.com/webmonkey/
     "squeeze the world 'til it's small enough to join us heel to toe"
         - jesus jones

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to