RE: surely an easy quick one

2001-09-14 Thread Colin Partridge




 
 select count(*) from table where team='support' group by team
 
 

I think that should be a group by name not by team.

--
Colin

-
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




RE: surely an easy quick one

2001-09-14 Thread Colin Partridge




 this doesnt work as i need either :o(

 it returns 3 rows, each with a count of 3 inside. i just want to get a
 *single row* with the number 3 in it (for my example).



You just need to add another clause to the where statement

  SELECT COUNT(*) FROM table WHERE team = support AND user=bob GROUP
BY name;

replacing bob with whover you wish to count

--
Colin


-
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




RE: surely an easy quick one

2001-09-14 Thread Colin Partridge


 
 Please ignore my last post.  I had lost track of what you were trying to
 achieve with your query.
 
 --
 Colin
 
 


-
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




RE: surely an easy quick one

2001-09-14 Thread Colin Partridge

 O.k, how about this query.

 SELECT DISTINCT name,count(1) AS numPeople FROM tester Where team
='support'
 GROUP BY team

 Its a bit dirty and it returns an extra column, but this could be ignored

 --
 Colin


-
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