DATABASE ERROR : select s.*,(select Program_name from tbl_program where pid=s.program) as program_name,DATE_FORMAT(s.created_on,'%d-%m-%Y %T') as created_on, if(s.last_modified='0000-00-00 00:00:00','',DATE_FORMAT(s.last_modified,'%d-%m-%Y %T')) as last_modified from tbl_syllabus s where 1=1 and academics='3' LIMIT 0,50 Subquery returns more than 1 row