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=2 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 (23037 , 23038 , 23050 , 23056 , 23057 , 24487 , 24489 , 24645 , 24646 , 24648 , 24653 , 24666 , 24667 , 24677 , 24678 , 24690 , 24691 , 24698 , 26574 , 26759 , 28992 , 29660 , 29734 , 31195 , 31196 , 31197 , 31207 , 31434 , 31517 , 31651 , 31735 , 31736 , 31794 , 31841 , 31842 , 32154 , 32474 , 33401 , 33848 , 34315 , 34578 , 34457 , 34463 , 34462 , 34558 , 34565 , 34579 , 35449 , 35170 , 35528) 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 (23037 , 23038 , 23050 , 2' at line 1