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 in (21,22,23,24) 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 (13016 , 13939 , 21098 , 24037 , 25944 , 28386 , 28985 , 28986 , 28987 , 30510 , 30688 , 30839 , 33453 , 24261 , 33800 , 13955 , 17184 , 18905 , 19059 , 19069 , 34767 , 21104 , 25914 , 27262 , 27377 , 27619 , 29555 , 31657 , 32606 , 32690 , 32841 , 33367 , 33610 , 33742 , 34395 , 34554 , 34580 , 34648 , 34684 , 34758) 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 (13016 , 13939 , 21098 , 2' at line 1