Re: surely an easy quick one

2001-09-16 Thread Chris
Use the DISTINCT keyword and count the returned rows - Original Message - 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

Re: surely an easy quick one

2001-09-16 Thread Richard Dice
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

surely an easy quick one

2001-09-14 Thread Jamie Burns
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: 1billsupport100 2billsupport101 3billsupport102 4ben development 201 5ben development 103 6

Re: surely an easy quick one

2001-09-14 Thread Stefan Pinkert
select count(*) from table where team='support' group by team -Ursprüngliche Nachricht- Von: Jamie Burns [mailto:[EMAIL PROTECTED]] Gesendet: Freitag, 14. September 2001 15:09 An: [EMAIL PROTECTED] Betreff: surely an easy quick one Hello again :o) This is surely an easy quick one

Re: surely an easy quick one

2001-09-14 Thread Lezz Giles
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: 1billsupport100 2billsupport101 3billsupport102 4ben development 201 5ben

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)

Re: surely an easy quick one

2001-09-14 Thread Jamie Burns
your query gets 9 from). :o( - Original Message - From: Stefan Pinkert [EMAIL PROTECTED] To: Jamie Burns [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Friday, September 14, 2001 2:25 PM Subject: Re: surely an easy quick one select count(*) from table where team='support' group by team

Re: surely an easy quick one

2001-09-14 Thread Aleksandar Bradaric
Hi, idname group_name -- 1bill support 100 2bill support 101 3bill support 102 4bendevelopment 201 5bendevelopment 103 6bendevelopment 204 7bobsupport

Re: surely an easy quick one

2001-09-14 Thread Jamie Burns
]; [EMAIL PROTECTED] Sent: Friday, September 14, 2001 2:29 PM Subject: Re: surely an easy quick one I haven't tested this; I'm not an SQL guru. I just like a challenge :-) SELECT COUNT(*) FROM table WHERE team = support GROUP BY name; Lezz Giles - Original Message - From: Jamie

Re: surely an easy quick one

2001-09-14 Thread Jamie Burns
. - Original Message - From: Lezz Giles [EMAIL PROTECTED] To: Jamie Burns [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Friday, September 14, 2001 2:29 PM Subject: Re: surely an easy quick one I haven't tested this; I'm not an SQL guru. I just like a challenge :-) SELECT COUNT(*) FROM table WHERE

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

Re: surely an easy quick one

2001-09-14 Thread Lezz Giles
Subject: Re: surely an easy quick one 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). :o( thanks for trying though... - Original Message - From: Lezz Giles [EMAIL

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)

Re[2]: surely an easy quick one

2001-09-14 Thread Aleksandar Bradaric
Hi, SELECT COUNT(DISTINCT name) from tester WHERE team = 'support' Could 2 queries do the trick? insert into temptable select count(name) from tester where team = 'support' group by team; select count(*) from temptable; Best Regards, Sasa P.S. create table temptable(tempfield

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,

Re: surely an easy quick one

2001-09-14 Thread Chris Johnson
If you want a count for a specific team: Select count(*) From table Where team = 'support'; If you want the counts for all the teams: Select team, count(*) From table Group By team; - Original Message - From: Jamie Burns [EMAIL PROTECTED] I have a table (ref, name, team, seminar_ref)

Re: surely an easy quick one

2001-09-14 Thread Chris Johnson
Woops! Nevermind. I didn't notice your data was denormalized. - Original Message - From: Chris Johnson [EMAIL PROTECTED] To: Jamie Burns [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Friday, September 14, 2001 10:33 PM Subject: Re: surely an easy quick one If you want a count