sql: SELECT SQL_CALC_FOUND_ROWS t1.*,t2.*,t3.*,t4.*,gdiv4.m_gene_div_name AS m_staff_birthplace from ( select * from t_diary where t_diary_delflag=0 and t_diray_pref_id=11 order by t_diary_regdate desc limit 3000 ) t1 inner join m_mall t2 on t1.t_diary_staff_mall_id=t2.m_mall_id left JOIN m_pref t3 ON t3.m_pref_id = t2.m_mall_pref_id left JOIN m_staff t4 ON t1.t_diary_staff_id = t4.m_staff_id LEFT JOIN m_gene_div gdiv4 ON gdiv4.m_gene_div_cd = m_staff_birthplace AND gdiv4.m_gene_div_group = 'birthplace' where 1=1 and m_staff_pc_disp = 1 m_mall_option_kb = 1 AND t1.t_diary_staff_mall_id IN (17591 , 18472 , 20793 , 20816 , 28039 , 31741 , 31871 , 33753 , 34255 , 34734 , 34757 , 34752 , 34884 , 34950 , 35329 , 35591) ORDER BY t_diary_regdate DESC, t_diary_id DESC LIMIT 0, 5
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'm_mall_option_kb = 1 AND t1.t_diary_staff_mall_id IN (17591 , 18472 , 20793 , 2' at line 1