MYSQL Group By Returning Duplicate Values -
i seeing weird problem mysql group by.
i have query...
select schools.schoolregion, count(schools.schoolregion) regioncount, ( select count(jobs_jobsubject) 'jobs' 'jobs_createddate' between '$startofyear' , '$endofyear') regionjobstotal 'jobs' left join 'schools' on 'jobs_schoolid'='sid' 'jobs_createddate' between '$startofyear' , '$endofyear' group 'schoolregion' ...in attempting total number of job postings listed per region , group region. have 2 tables, 1 list of schools , job information has column value joins school. need region total, , overall total of jobs within time period (hence sub query).
when run query, expect - except getting duplicate region listing in returned results of group function.
for example, here table getting not sure why duplicate middle east.
schoolregion regioncount regionjobstotal africa 1 38 asia 6 38 middle east 20 38 middle east 11 38 i thought maybe there character or something, not find/see different values within tables - column being stored type "text". there can check for? query?
any fantastic , appreciated!!
my guess data not ordered schoolregion. add order schoolregion asc query ensure organized thusly. :)
Comments
Post a Comment