Invalid query: SELECT j.opening_id, j.user_id, trim(j.position) as position, j.location_id,DATE_FORMAT(j.opening_date, '%Y-%m-%d') as job_posting_date, i.catname as industryname, j.location_id as locationname, e.catname as experience,e.cat_id as experiencereqid, u.nick_name,com.company_name, (select catname FROM mast_compensate where cat_id=j.min_compensation) as min_compensate, (select catname from mast_compensate where cat_id=j.max_compensation) as max_compensate, j.job_description FROM tbl_job_opening j, mast_industry i, mast_experience e, tbl_users u, tbl_company com WHERE j.industry_id = i.cat_id AND j.experience_id = e.cat_id AND j.user_id = u.user_id AND = com.company_id group by j.opening_id order by apply_date asc -Unknown column 'apply_date' in 'order clause'