sql: SELECT SQL_CALC_FOUND_ROWS m_mall_id ,m_mall_name ,m_mall_kana ,m_mall_corp_period ,m_cgjob_id , m_cgjob_corp_id , m_cgjob_recruitment_job , m_cgjob_location , m_cgjob_job_id , m_cgjob_qualifications , m_cgjob_favorable_conditions , m_cgjob_apply_condition_supple , m_cgjob_work_day , m_cgjob_start_time , m_cgjob_end_time , m_cgjob_self_shift_flg , m_cgjob_home_work_flg , m_cgjob_work_supple , m_cgjob_hourly_flg , m_cgjob_hourly_amount , m_cgjob_hourly_method , m_cgjob_daily_wages_flg , m_cgjob_daily_amount , m_cgjob_daily_method , m_cgjob_salary_flg , m_cgjob_monthly_amount , m_cgjob_monthly_method , m_cgjob_annual_salary_flg , m_cgjob_annual_amount , m_cgjob_annual_method , m_cgjob_volume_flg , m_cgjob_volume_amount , m_cgjob_volume_method , m_cgjob_guaranteed_minimum_flg , m_cgjob_guaranteed_minimum , m_cgjob_bonus_flg , m_cgjob_bonus_amount , m_cgjob_bonus_interval , m_cgjob_bonus_num , m_cgjob_salary_supple , m_cgjob_allowance , m_cgjob_general_allowance , m_cgjob_near_rails , m_cgjob_near_station , m_cgjob_transport , m_cgjob_travel_time , m_cgjob_traffic_supple , m_cgjob_traffic_view_flg , m_cgjob_general_apply_method , m_cgjob_apply_supple , m_cgjob_tel , m_cgjob_email , m_cgjob_meta_title , m_cgjob_meta_description , m_cgjob_meta_keyword , m_cgjob_center_freespace , m_cgjob_update , m_cgjob_search_text , m_corp_id , m_corp_login_id , m_corp_login_pass , m_corp_name , m_corp_zip , m_corp_address , m_corp_tel1 , m_corp_tel2 , m_corp_fax , m_corp_owner_name , m_corp_subowner_name , m_corp_email , m_corp_status , m_corp_pr_title , m_corp_pr_body , m_corp_official , m_corp_official_mobile , m_corp_meta_title , m_corp_meta_description , m_corp_meta_keyword , m_corp_description_comment1 , m_corp_description_comment2 , m_corp_description_comment3 , m_corp_description_image1 , m_corp_description_image2 , m_corp_description_image3 , m_corp_center_freespace , m_corp_right_freespace_title , m_corp_right_freespace ,m_mall_public_business_name ,m_mall_directory ,m_minfo_lat ,m_minfo_lon ,(CASE m_business_deli_flg WHEN 1 THEN (SELECT m_deli_amu_area_name FROM m_deli_amu_area WHERE m_deli_amu_area_id = m_mall_location_deli_amu_area_id) ELSE m_minfo_addr END) AS m_minfo_addr ,m_minfo_station ,m_minfo_open ,m_minfo_close ,m_minfo_holiday ,m_area_name ,m_area_code ,m_pref_id ,m_pref_name ,m_pref_code ,m_amu_area_id ,m_amu_area_name ,m_s_amu_area_id ,m_s_amu_area_name ,m_business_id ,m_business_name ,CASE WHEN m_business_id IN (12,13) AND m_mall_deli_flg = 1 AND m_minfo_deli_flg = 1 THEN 1 ELSE m_business_deli_flg END AS m_business_deli_flg ,CASE WHEN m_business_id IN (12,13) AND m_mall_deli_flg = 1 AND m_minfo_deli_flg = 1 THEN 1 END AS untrue_deli_flg ,m_s_business_name ,m_s_business_id ,m_s_business_job_type ,m_job_name ,m_s_job_name ,m_s_job_id ,m_deli_amu_area_id ,m_deli_amu_area_name ,m_minfo_description_comment1 ,m_minfo_description_comment2 ,m_minfo_description_comment3, '' as t_job_news_title, '' as t_job_news_body, '' as t_job_news_startdate ,'general' as search_kb , m_mall_reco_flg FROM m_corporation mc INNER JOIN m_mall ON m_mall_corp_id = mc.m_corp_id AND m_mall_general_job_status = 1 AND m_mall_general_job_public_flg = 1 AND m_mall_corp_period >= CURRENT_DATE INNER JOIN m_corp_general_job cgj ON cgj.m_cgjob_corp_id = mc.m_corp_id INNER JOIN m_mall_info ON m_mall_id = m_minfo_mall_id INNER JOIN t_mall_general_job_view ON t_mgjv_mall_id = m_mall_id AND t_mgjv_cgjob_id = cgj.m_cgjob_id INNER JOIN m_pref ON m_pref_id = m_mall_pref_id INNER JOIN m_area ON m_area_id = m_pref_area_id INNER JOIN m_amu_area ON m_amu_area_id = m_mall_amu_area_id INNER JOIN m_s_amu_area ON m_s_amu_area_id = m_amu_area_s_amu_area_id INNER JOIN m_deli_amu_area ON m_deli_amu_area_id = m_amu_area_deli_amu_area_id INNER JOIN m_business ON m_business_id = m_mall_business_id INNER JOIN m_s_business ON m_s_business_id = m_business_s_business_id INNER JOIN m_job ON m_cgjob_job_id = m_job_id INNER JOIN m_s_job ON m_s_job_id = m_job_s_job_id WHERE m_mall_del_flg = 0 AND m_mall_view_flg = 1 AND m_mall_confirm_flg = 1 AND m_s_job_id IN (99999) UNION SELECT m_mall_id ,m_mall_name ,m_mall_kana ,m_mall_corp_period ,gj.m_mgjob_id AS m_cgjob_id ,gj.m_mgjob_corp_id AS m_cgjob_corp_id ,'' AS recruitment_job ,'' AS m_cgjob_location ,'' AS m_cgjob_job_id ,CASE WHEN gj.m_mgjob_synchro_flg = 1 THEN mgj.m_mgjob_qualifications ELSE gj.m_mgjob_qualifications END AS m_cgjob_qualifications ,CASE WHEN gj.m_mgjob_synchro_flg = 1 THEN mgj.m_mgjob_favorable_conditions ELSE gj.m_mgjob_favorable_conditions END AS m_cgjob_favorable_conditions ,CASE WHEN gj.m_mgjob_synchro_flg = 1 THEN mgj.m_mgjob_apply_condition_supple ELSE gj.m_mgjob_apply_condition_supple END AS m_cgjob_apply_condition_supple ,CASE WHEN gj.m_mgjob_synchro_flg = 1 THEN mgj.m_mgjob_work_day ELSE gj.m_mgjob_work_day END AS m_cgjob_work_day ,CASE WHEN gj.m_mgjob_synchro_flg = 1 THEN mgj.m_mgjob_start_time ELSE gj.m_mgjob_start_time END AS m_cgjob_start_time ,CASE WHEN gj.m_mgjob_synchro_flg = 1 THEN mgj.m_mgjob_end_time ELSE gj.m_mgjob_end_time END AS m_cgjob_end_time ,CASE WHEN gj.m_mgjob_synchro_flg = 1 THEN mgj.m_mgjob_self_shift_flg ELSE gj.m_mgjob_self_shift_flg END AS m_cgjob_self_shift_flg ,'' AS m_cgjob_home_work_flg ,CASE WHEN gj.m_mgjob_synchro_flg = 1 THEN mgj.m_mgjob_work_supple ELSE gj.m_mgjob_work_supple END AS m_cgjob_work_supple ,CASE WHEN gj.m_mgjob_synchro_flg = 1 THEN mgj.m_mgjob_hourly_flg ELSE gj.m_mgjob_hourly_flg END AS m_cgjob_hourly_flg ,CASE WHEN gj.m_mgjob_synchro_flg = 1 THEN mgj.m_mgjob_hourly_amount ELSE gj.m_mgjob_hourly_amount END AS m_cgjob_hourly_amount ,CASE WHEN gj.m_mgjob_synchro_flg = 1 THEN mgj.m_mgjob_hourly_method ELSE gj.m_mgjob_hourly_method END AS m_cgjob_hourly_method ,CASE WHEN gj.m_mgjob_synchro_flg = 1 THEN mgj.m_mgjob_daily_wages_flg ELSE gj.m_mgjob_daily_wages_flg END AS m_cgjob_daily_wages_flg ,CASE WHEN gj.m_mgjob_synchro_flg = 1 THEN mgj.m_mgjob_daily_amount ELSE gj.m_mgjob_daily_amount END AS m_cgjob_daily_amount ,CASE WHEN gj.m_mgjob_synchro_flg = 1 THEN mgj.m_mgjob_daily_method ELSE gj.m_mgjob_daily_method END AS m_cgjob_daily_method ,CASE WHEN gj.m_mgjob_synchro_flg = 1 THEN mgj.m_mgjob_salary_flg ELSE gj.m_mgjob_salary_flg END AS m_cgjob_salary_flg ,CASE WHEN gj.m_mgjob_synchro_flg = 1 THEN mgj.m_mgjob_monthly_amount ELSE gj.m_mgjob_monthly_amount END AS m_cgjob_monthly_amount ,CASE WHEN gj.m_mgjob_synchro_flg = 1 THEN mgj.m_mgjob_monthly_method ELSE gj.m_mgjob_monthly_method END AS m_cgjob_monthly_method ,'' AS m_cgjob_annual_salary_flg ,'' AS m_cgjob_annual_amount ,'' AS m_cgjob_annual_method ,CASE WHEN gj.m_mgjob_synchro_flg = 1 THEN mgj.m_mgjob_volume_flg ELSE gj.m_mgjob_volume_flg END AS m_cgjob_volume_flg ,CASE WHEN gj.m_mgjob_synchro_flg = 1 THEN mgj.m_mgjob_volume_amount ELSE gj.m_mgjob_volume_amount END AS m_cgjob_volume_amount ,CASE WHEN gj.m_mgjob_synchro_flg = 1 THEN mgj.m_mgjob_volume_method ELSE gj.m_mgjob_volume_method END AS m_cgjob_volume_method ,CASE WHEN gj.m_mgjob_synchro_flg = 1 THEN mgj.m_mgjob_guaranteed_minimum_flg ELSE gj.m_mgjob_guaranteed_minimum_flg END AS m_cgjob_guaranteed_minimum_flg ,CASE WHEN gj.m_mgjob_synchro_flg = 1 THEN mgj.m_mgjob_guaranteed_minimum ELSE gj.m_mgjob_guaranteed_minimum END AS m_cgjob_guaranteed_minimum ,CASE WHEN gj.m_mgjob_synchro_flg = 1 THEN mgj.m_mgjob_bonus_flg ELSE gj.m_mgjob_bonus_flg END AS m_cgjob_bonus_flg ,CASE WHEN gj.m_mgjob_synchro_flg = 1 THEN mgj.m_mgjob_bonus_amount ELSE gj.m_mgjob_bonus_amount END AS m_cgjob_bonus_amount ,CASE WHEN gj.m_mgjob_synchro_flg = 1 THEN mgj.m_mgjob_bonus_interval ELSE gj.m_mgjob_bonus_interval END AS m_cgjob_bonus_interval ,CASE WHEN gj.m_mgjob_synchro_flg = 1 THEN mgj.m_mgjob_bonus_num ELSE gj.m_mgjob_bonus_num END AS m_cgjob_bonus_num ,CASE WHEN gj.m_mgjob_synchro_flg = 1 THEN mgj.m_mgjob_salary_supple ELSE gj.m_mgjob_salary_supple END AS m_cgjob_salary_supple ,CASE WHEN gj.m_mgjob_synchro_flg = 1 THEN mgj.m_mgjob_allowance ELSE gj.m_mgjob_allowance END m_cgjob_allowance ,CASE WHEN gj.m_mgjob_synchro_flg = 1 THEN mgj.m_mgjob_girl_allowance ELSE gj.m_mgjob_girl_allowance END AS m_cgjob_general_allowance ,'' AS m_cgjob_near_rails ,'' AS m_cgjob_near_station ,'' AS m_cgjob_transport ,'' AS m_cgjob_travel_time ,'' AS m_cgjob_traffic_supple ,'' AS m_cgjob_traffic_view_flg ,CASE WHEN gj.m_mgjob_synchro_flg = 1 THEN mgj.m_mgjob_general_apply_method ELSE gj.m_mgjob_general_apply_method END AS m_cgjob_general_apply_method ,CASE WHEN gj.m_mgjob_synchro_flg = 1 THEN mgj.m_mgjob_apply_supple ELSE gj.m_mgjob_apply_supple END AS m_cgjob_apply_supple ,CASE WHEN gj.m_mgjob_synchro_flg = 1 THEN mgj.m_mgjob_tel ELSE gj.m_mgjob_tel END AS m_cgjob_tel ,CASE WHEN gj.m_mgjob_synchro_flg = 1 THEN mgj.m_mgjob_email ELSE gj.m_mgjob_email END AS m_cgjob_email ,CASE WHEN gj.m_mgjob_synchro_flg = 1 THEN mgj.m_mgjob_meta_title ELSE gj.m_mgjob_meta_title END AS m_cgjob_meta_title ,CASE WHEN gj.m_mgjob_synchro_flg = 1 THEN mgj.m_mgjob_meta_description ELSE gj.m_mgjob_meta_description END AS m_cgjob_meta_description ,CASE WHEN gj.m_mgjob_synchro_flg = 1 THEN mgj.m_mgjob_meta_keyword ELSE gj.m_mgjob_meta_keyword END AS m_cgjob_meta_keyword ,CASE WHEN gj.m_mgjob_synchro_flg = 1 THEN mgj.m_mgjob_center_freespace ELSE gj.m_mgjob_center_freespace END AS m_cgjob_center_freespace ,CASE WHEN gj.m_mgjob_synchro_flg = 1 THEN mgj.m_mgjob_update ELSE gj.m_mgjob_update END AS m_cgjob_update ,CASE WHEN gj.m_mgjob_synchro_flg = 1 THEN mgj.m_mgjob_search_text ELSE mgj.m_mgjob_search_text END AS m_cgjob_search_text , m_corp_id , m_corp_login_id , m_corp_login_pass , m_corp_name , m_corp_zip , m_corp_address , m_corp_tel1 , m_corp_tel2 , m_corp_fax , m_corp_owner_name , m_corp_subowner_name , m_corp_email , m_corp_status , CASE WHEN gj.m_mgjob_synchro_flg = 1 THEN mgj.m_mgjob_title ELSE gj.m_mgjob_title END AS m_corp_pr_title , CASE WHEN gj.m_mgjob_synchro_flg = 1 THEN mgj.m_mgjob_body ELSE gj.m_mgjob_body END AS m_corp_pr_body , m_corp_official , m_corp_official_mobile , m_corp_meta_title , m_corp_meta_description , m_corp_meta_keyword , m_corp_description_comment1 , m_corp_description_comment2 , m_corp_description_comment3 , m_corp_description_image1 , m_corp_description_image2 , m_corp_description_image3 , m_corp_center_freespace , m_corp_right_freespace_title , m_corp_right_freespace , m_mall_public_business_name , m_mall_directory , m_minfo_lat , m_minfo_lon ,(CASE m_business_deli_flg WHEN 1 THEN (SELECT m_deli_amu_area_name FROM m_deli_amu_area WHERE m_deli_amu_area_id = m_mall_location_deli_amu_area_id) ELSE m_minfo_addr END) AS m_minfo_addr , m_minfo_station , m_minfo_open , m_minfo_close , m_minfo_holiday , m_area_name , m_area_code , m_pref_id , m_pref_name , m_pref_code , m_amu_area_id , m_amu_area_name , m_s_amu_area_id , m_s_amu_area_name , m_business_id , m_business_name , CASE WHEN m_business_id IN (12,13) AND m_mall_deli_flg = 1 AND m_minfo_deli_flg = 1 THEN 1 ELSE m_business_deli_flg END AS m_business_deli_flg , CASE WHEN m_business_id IN (12,13) AND m_mall_deli_flg = 1 AND m_minfo_deli_flg = 1 THEN 1 END AS untrue_deli_flg , m_s_business_name , m_s_business_id , m_s_business_job_type ,'' AS m_job_name , m_s_job_name , m_s_job_id ,m_deli_amu_area_id ,m_deli_amu_area_name , m_mall_info.m_minfo_description_comment1 , m_mall_info.m_minfo_description_comment2 , m_mall_info.m_minfo_description_comment3, '' as t_job_news_title, '' as t_job_news_body, '' as t_job_news_startdate, 'girl' AS search_kb, m_mall_reco_flg FROM m_mall INNER JOIN m_corporation ON m_mall_corp_id = m_corp_id INNER JOIN m_mall_girl_job gj ON gj.m_mgjob_mall_id = m_mall.m_mall_id AND m_mall_girl_job_status = 1 AND m_mall_girl_job_public_flg = 1 AND m_mall_corp_period >= CURRENT_DATE INNER JOIN m_mall_info ON m_mall_id = m_minfo_mall_id LEFT JOIN (SELECT m_mall_girl_job.*, m_minfo_description_comment1, m_minfo_description_comment2, m_minfo_description_comment3 FROM m_mall_girl_job INNER JOIN m_mall ON m_mgjob_mall_id = m_mall_id INNER JOIN m_mall_info minfo ON m_minfo_mall_id = m_mall_id WHERE 1= 1 AND m_mall_girl_job_status = 1 AND m_mall_girl_job_public_flg = 1 AND m_mall_corp_period >= CURRENT_DATE AND m_mall_corp_master_flg = 1 ) mgj ON mgj.m_mgjob_corp_id = gj.m_mgjob_corp_id INNER JOIN m_pref ON m_pref_id = m_mall_pref_id INNER JOIN m_area ON m_area_id = m_pref_area_id INNER JOIN m_amu_area ON m_amu_area_id = m_mall_amu_area_id INNER JOIN m_s_amu_area ON m_s_amu_area_id = m_amu_area_s_amu_area_id INNER JOIN m_deli_amu_area ON m_deli_amu_area_id = m_amu_area_deli_amu_area_id INNER JOIN m_business ON m_business_id = m_mall_business_id INNER JOIN m_s_business ON m_s_business_id = m_business_s_business_id AND m_s_business_job_type = 2 LEFT JOIN m_s_job ON m_s_job_type = m_s_business_job_type WHERE 1 AND m_s_business_job_type = 2 AND m_s_business_id IN (a) ORDER BY m_cgjob_update DESC LIMIT 0, 20
Unknown column 'a' in 'where clause'