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=34 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 (23654 , 23660 , 23661 , 23687 , 24260 , 24299 , 25348 , 25350 , 25776 , 25777 , 25778 , 25924 , 26343 , 26492 , 26608 , 26616 , 26635 , 26923 , 26924 , 27426 , 27725 , 27905 , 28095 , 28533 , 28605 , 28626 , 28699 , 28712 , 28815 , 28921 , 29144 , 29149 , 29304 , 29306 , 29318 , 29514 , 29564 , 29616 , 29739 , 29754 , 30268 , 30269 , 30547 , 30869 , 31229 , 31238 , 31323 , 31331 , 31563 , 31584 , 31786 , 31965 , 32521 , 32595 , 32683 , 32689 , 32763 , 32764 , 32785 , 32906 , 33174 , 33175 , 33179 , 33447 , 33585 , 34113 , 34117 , 34184 , 34237 , 34506 , 34507 , 34528 , 34930 , 34929 , 34931 , 34932) 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 (23654 , 23660 , 23661 , 2' at line 1