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='ana' AND programid IN (2853, 2854, 2855, 2856, 2856, 2857, 2858, 2859, 2860, 2861, 2862, 2863, 2864, 2865, 2973, 2866, 7957, 2868, 2869, 2870, 7958, 2872, 2873, 2874, 2875, 2875, 7946, 2876, 2877, 2933, 2929, 2878, 2879, 2880, 2881, 2882, 2883, 2884, 2885, 2886, 2888, 2889, 2889, 2889, 2891, 2878, 2891, 2892, 2893, 2894, 2895, 2896, 2897, 7944, 2899, 2900, 7979, 2901, 2902, 2903, 2905, 2905, 2906, 2907, 2908, 2909, 2910, 7984, 2910, 2912, 2912, 2912, 2913, 2914, 2915, 2916, 2917, 2925, 2926, 2906, 7986, 2927, 2928, 2928, 2929, 2930, 2931, 2932, 2933, 2934, 2935, 2936, 7981, 7981, 2937, 2937, 2938, 2939, 2940, 2940, 2941, 2946, 2947, 2948, 2949, 2950, 2951, 2952, 2953, 2954, 2955, 2956, 2957, 2958, 2959, 2960, 2961, 2962, 2964, 2965, 2967, 2968, 7957, 2969, 2867, 2970, 2971, 2972, 2973, 2975, 2976, 2977, 2978, 2979, 2980, 2981, 2982, 2983, 2984, 2985, 2985, 2987, 2988, 2989, 2990, 2926, 2991, 2992, 2993, 2994, 2995, 2889, 2996, 6265, 2997, 2998, 2999, 2906, 3000, 3001, 3002, 2934, 3573, 2871, 6268, 6269, 6269, 2988, 7956, 7955, 6270, 6271, 6741, 2976, 7898, 7897, 7907, 7901, 7900, 7899, 7906, 7905, 7902, 7903, 7904, 2940, 2941, 7924, 7926, 7925, 7927, 7928, 7930, 7929, 7932, 7931, 7935, 7936, 7934, 7934, 7933, 7933, 7940, 7939, 7938, 7937, 2930, 7941, 7945, 7945, 7950, 7948, 7947, 7949, 7953, 7953, 7954, 7952, 7951, 7951, 7952, 6271, 2881, 7959, 7964, 7964, 7963, 7962, 7962, 7961, 7965, 7967, 7966, 7968, 7969, 7974, 7972, 7971, 7970, 7975, 7973, 2900, 7978, 7977, 7976, 7980, 7983, 7982, 7985, 2905, 7989, 2889, 2889, 7988, 7987, 2912, 2912, 7990, 7991, 7999, 8000, 7992, 7993, 7994, 7994, 7998, 7997, 7996, 7995, 8005, 8005, 2853, 8006, 8006, 8009, 8008, 6741);; Column 'programid' in where clause is ambiguous