![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi MySQL Fans ;-) I would like to list all courses with have less than lets say 10 participants. Does anybody know how I would have to modify the code below to get this to work ? schedule_id is the course itself SELECT schedule_id,count(schedule_id) FROM attendance WHERE count(schedule_id)<10 GROUP BY schedule_id ; My problem is that I would need to use the count function actually within the WHERE (clause which is not allowed). |
#3
| |||
| |||
|
|
I would like to list all courses with have less than lets say 10 participants. Does anybody know how I would have to modify the code below to get this to work ? schedule_id is the course itself SELECT schedule_id,count(schedule_id) FROM attendance WHERE count(schedule_id)<10 GROUP BY schedule_id ; My problem is that I would need to use the count function actually within the WHERE (clause which is not allowed). |
#4
| |||
| |||
|
|
On Fri, 2003-07-11 at 13:41, Nils Valentin wrote: Hi MySQL Fans ;-) I would like to list all courses with have less than lets say 10 participants. Does anybody know how I would have to modify the code bel= ow to get this to work ? schedule_id is the course itself SELECT schedule_id,count(schedule_id) FROM attendance WHERE count(schedule_id)<10 GROUP BY schedule_id ; My problem is that I would need to use the count function actually with= in the WHERE (clause which is not allowed). Try SELECT schedule_id,count(schedule_id) as attendees FROM attendance WHERE antendees<10 GROUP BY schedule_id ; Johnn Coder |
#5
| |||
| |||
|
|
Hi Bruce; Thank you for the reply. I passed the core exam but obviously its not enough ;-) Live and learn ;-) |
|
Thank you very much for the reply. Best regards Nils Valentin 2003=E5=B9=B4 7=E6=9C=88 12=E6=97=A5 =E5=9C=9F=E6=9B=9C=E6=97=A5 10:20=E3= =80=81Bruce Feist =E3=81=95=E3=82=93=E3=81=AF=E6=9B=B8=E3=81=8D=E3=8 1=BE=E3= |
|
Nils Valentin wrote: I would like to list all courses with have less than lets say 10 participants. Does anybody know how I would have to modify the code below to get this to work ? schedule_id is the course itself SELECT schedule_id,count(schedule_id) FROM attendance WHERE count(schedule_id)<10 GROUP BY schedule_id ; My problem is that I would need to use the count function actually within the WHERE (clause which is not allowed). That's precisely why HAVING exists. SELECT schedule_id,count(schedule_id) FROM attendance HAVING count(schedule_id) <10 GROUP BY schedule_id ; Bruce Feist |
#6
| |||
| |||
|
|
Nils Valentin wrote: I would like to list all courses with have less than lets say 10 participants. Does anybody know how I would have to modify the code bel= ow to get this to work ? schedule_id is the course itself SELECT schedule_id,count(schedule_id) FROM attendance WHERE count(schedule_id)<10 GROUP BY schedule_id ; My problem is that I would need to use the count function actually within the WHERE (clause which is not allowed). That's precisely why HAVING exists. SELECT schedule_id,count(schedule_id) FROM attendance HAVING count(schedule_id) <10 GROUP BY schedule_id ; Bruce Feist |
#7
| |||
| |||
|
|
Nils Valentin wrote: I would like to list all courses with have less than lets say 10 participants. Does anybody know how I would have to modify the code bel= ow to get this to work ? schedule_id is the course itself SELECT schedule_id,count(schedule_id) FROM attendance WHERE count(schedule_id)<10 GROUP BY schedule_id ; My problem is that I would need to use the count function actually within the WHERE (clause which is not allowed). That's precisely why HAVING exists. SELECT schedule_id,count(schedule_id) FROM attendance HAVING count(schedule_id) <10 GROUP BY schedule_id ; Bruce Feist |
#8
| |||
| |||
|
|
Hi Bruce; Thank you for the reply. I passed the core exam but obviously its not enough ;-) Live and learn ;-) |
|
Thank you very much for the reply. Best regards Nils Valentin 2003年 7月 12日 土曜日 10:20、Bruce Feist さんは書きました: Nils Valentin wrote: I would like to list all courses with have less than lets say 10 participants. Does anybody know how I would have to modify the code below to get this to work ? schedule_id is the course itself SELECT schedule_id,count(schedule_id) FROM attendance WHERE count(schedule_id)<10 GROUP BY schedule_id ; My problem is that I would need to use the count function actually within the WHERE (clause which is not allowed). That's precisely why HAVING exists. SELECT schedule_id,count(schedule_id) FROM attendance HAVING count(schedule_id) <10 GROUP BY schedule_id ; Bruce Feist |
#9
| |||
| |||
|
|
Actually, "Live and Learn" is correct. "Life and Learn" makes no sense. Edward Dudlik Becoming Digital www.becomingdigital.com Did I help you? Want to show your thanks? www.amazon.com/o/registry/EGDXEBBWTYUU ----- Original Message ----- From: "Nils Valentin" <nils (AT) knowd (DOT) co.jp To: "Bruce Feist" <bfeist (AT) flock (DOT) org Cc: <mysql (AT) lists (DOT) mysql.com Sent: Friday, 11 July, 2003 22:16 Subject: Re: Request modelling 2003=E5=B9=B4 7=E6=9C=88 12=E6=97=A5 =E5=9C=9F=E6=9B=9C=E6=97=A5 10:55=E3= =80=81Nils Valentin =E3=81=95=E3=82=93=E3=81=AF=E6=9B=B8=E3=81=8D=E3=8 1=BE= |
|
Hi Bruce; Thank you for the reply. I passed the core exam but obviously its not enough ;-) Live and learn ;-) Aeeh thats was supposed to be ... life and learn.. Perhaps somebody knows a good spellchecker for logical mistakes ?? ;-) That would have immediately popped up on my screen ;-) Best regards Nils Valentin Tokyo/Japan Thank you very much for the reply. Best regards Nils Valentin 2003=E5=B9=B4 7=E6=9C=88 12=E6=97=A5 =E5=9C=9F=E6=9B=9C=E6=97=A5 10:20= =E3=80=81Bruce Feist =E3=81=95=E3=82=93=E3=81=AF=E6=9B=B8=E3=81=8D=E3=8 1=BE= |
|
Nils Valentin wrote: I would like to list all courses with have less than lets say 10 participants. Does anybody know how I would have to modify the code below to get this to work ? schedule_id is the course itself SELECT schedule_id,count(schedule_id) FROM attendance WHERE count(schedule_id)<10 GROUP BY schedule_id ; My problem is that I would need to use the count function actually within the WHERE (clause which is not allowed). That's precisely why HAVING exists. SELECT schedule_id,count(schedule_id) FROM attendance HAVING count(schedule_id) <10 GROUP BY schedule_id ; Bruce Feist -- --- Valentin Nils Internet Technology E-Mail: nils (AT) knowd (DOT) co.jp URL: http://www.knowd.co.jp Personal URL: http://www.knowd.co.jp/staff/nils -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: =20 http://lists.mysql.com/mysql?unsub=3...ital (DOT) com |
![]() |
| Thread Tools | |
| Display Modes | |
| |