Please log in | Help




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,, count(*) as CHILDREN, efmp_family.user_id FROM efmp_family, efmp_child, site_lookup where efmp_family.user_id = and = efmp_child.fm_id and efmp_family.primary_site=site_lookup.siteID and efmp_family.primary_site is not NULL GROUP BY primary_site, 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_child.fm_id and efmp_family.primary_site=site_l' at line 5