SELECT F.TitleEN,(SELECT COUNT(*) FROM tbl_product_service AS L WHERE L.ParentID = AND L.ValueID = F.ID) FROM tbl_service AS F ORDER BY F.TitleEN ASC: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 L.ValueID = F.ID) FROM tbl_service AS F ORDER BY F.TitleEN ASC' at line 1