Error on run query : SELECT CASE WHEN mt_school.school_name2 = '' THEN mt_school.school_name1 ELSE CONCAT(mt_school.school_name1,' - ',mt_school.school_name2) END AS school_name, mt_school.schoolid, mt_program.program_name, mt_program.programid, mt_program.intake, mt_program.duration, mt_program.duration_from, mt_program.duration_to, mt_program.gmat_status, mt_program.gmat_waiver FROM mt_school INNER JOIN mt_program ON mt_school.schoolid=mt_program.schoolid INNER JOIN mt_program_location ON mt_program.programid=mt_program_location.programid WHERE mt_program_location.country IN ('US','CA') AND mt_program.masters_type='fin' AND programid IN (1652, 1653, 1654, 1655, 1656, 1658, 1659, 1659, 1659, 5646);; Column 'programid' in where clause is ambiguous