Please log in | Help

Lists/Reports

Enrolled

All

SELECT PRIMARY_SITE, SITE_NAME, Count(*) AS FAMILIES, SUM(CHILDREN) AS TOTAL_CHILDREN FROM (SELECT efmp_family.primary_site as PRIMARY_SITE, site_lookup.siteName as SITE_NAME, efmp_family.id, count(*) as CHILDREN, efmp_family.user_id FROM efmp_family, efmp_child, site_lookup where efmp_family.user_id = and efmp_family.id = efmp_child.fm_id and efmp_family.primary_site=site_lookup.siteID and efmp_family.primary_site is not NULL GROUP BY primary_site, efmp_family.id) As AAA GROUP BY PRIMARY_SITE ORDER BY PRIMARY_SITE
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'and efmp_family.id = efmp_child.fm_id and efmp_family.primary_site=site_l' at line 5