Here, I have whittled the query down to just the essentials:

SELECT even.even_title, (
                SELECT COUNT(meev.meev_id)
                FROM dev_cscca.members_events meev
                WHERE meev.meev_date_scheduled is not NULL
                ) as count
FROM dev_cscca.events even


…which returns:

+-------------------------+-------+
| even_title              | count |
+-------------------------+-------+
| First aid certification |     3 |
| 2010 Annual Conference  |     3 |
| CPR Certification       |     3 |
+-------------------------+-------+


I want it to return:

+-------------------------+-------+
| even_title              | count |
+-------------------------+-------+
| First aid certification |    1 |
| 2010 Annual Conference  |    1 |
| CPR Certification       |    1 |
+-------------------------+-------+


…because I only have one person registered for each event.

Here is a pastebin of the tables:

http://stikked.com/view/raw/63799305

_______________________________________________

UPHPU mailing list
[email protected]
http://uphpu.org/mailman/listinfo/uphpu
IRC: #uphpu on irc.freenode.net

Reply via email to