[UPHPU] adding a count to an MySQL query

Justin Giboney jgiboney at gmail.com
Thu Dec 24 11:36:06 MST 2009


Let me see if I got your tables down right (there may be extra non-necessary
fields)

dev_cscca.members_events (meev_id, meev_date_scheduled)
dev_cscca_cms.users (user_id)
dev_cscca.events (even_id
, even_title, even_status, even_start, even_end, even_modifiedby, even_type)
   FK: even_modifiedby = dev_cscca_cms.users.user_id



On Thu, Dec 24, 2009 at 11:26 AM, Wade Preston Shearer <
wadeshearer.lists at me.com> wrote:

> On 24 Dec 2009, at 11:18, Randy Moller wrote:
>
> > You could use a group by based on the event location to get the
> > count by group.
>
> That's closer, but the subquery now returns multiple rows. I still
> need a way to only select the rows (for the count) from the many-to-
> many table for events users are registered for that match the row
> currently being selected from the main query
>
> I need a meev.meev_even_id=even.even_id somewhere.
>
>
>
> _______________________________________________
>
> UPHPU mailing list
> UPHPU at uphpu.org
> http://uphpu.org/mailman/listinfo/uphpu
> IRC: #uphpu on irc.freenode.net
>


More information about the UPHPU mailing list