Re: Count records in join

2009-12-16 Thread Johan De Meersman
-Original Message- From: Miguel Vaz [mailto:pagong...@gmail.com] Sent: Tuesday, December 15, 2009 10:43 AM To: mysql@lists.mysql.com Subject: Count records in join Hi, I am stuck with a suposedly simple query: - i have two tables (: PROGS id_prog name EVENTS id id_prog

Re: Count records in join

2009-12-16 Thread Miguel Vaz
Subject: Count records in join Hi, I am stuck with a suposedly simple query: - i have two tables (: PROGS id_prog name EVENTS id id_prog name How can i list all records from PROGS with a sum of how many events each have? I want to find the progs that are empty. I remember something

RE: Count records in join

2009-12-16 Thread Jerry Schwartz
-Original Message- From: Miguel Vaz [mailto:pagong...@gmail.com] Sent: Wednesday, December 16, 2009 9:39 AM To: Johan De Meersman Cc: Gavin Towey; mysql@lists.mysql.com Subject: Re: Count records in join Thanks all for the feedback. Here's what i did: select p.id_prog,count(r.id_event) e

Re: Count records in join

2009-12-16 Thread Miguel Vaz
: -Original Message- From: Miguel Vaz [mailto:pagong...@gmail.com] Sent: Wednesday, December 16, 2009 9:39 AM To: Johan De Meersman Cc: Gavin Towey; mysql@lists.mysql.com Subject: Re: Count records in join Thanks all for the feedback. Here's what i did: select p.id_prog,count(r.id_event

Count records in join

2009-12-15 Thread Miguel Vaz
Hi, I am stuck with a suposedly simple query: - i have two tables (: PROGS id_prog name EVENTS id id_prog name How can i list all records from PROGS with a sum of how many events each have? I want to find the progs that are empty. I remember something about using NULL, but i cant remember.

RE: Count records in join

2009-12-15 Thread Gavin Towey
[mailto:pagong...@gmail.com] Sent: Tuesday, December 15, 2009 10:43 AM To: mysql@lists.mysql.com Subject: Count records in join Hi, I am stuck with a suposedly simple query: - i have two tables (: PROGS id_prog name EVENTS id id_prog name How can i list all records from PROGS with a sum of how