这条联合sql语句哪里错了?
橱窗的光
橱窗的光 2017-03-06 10:14:24
0
2
827
((( SELECT a.log_id,`create_date`,`content`,`creator`,`belong_to_user`,a.customer_code,`follow_up_way` FROM gs_log a left join gs_customer b on a.customer_code = b.customer_code WHERE ( b.customer_code != '' AND b.customer_id = 2212 ) )) union (( SELECT a.log_id,`create_date`,`content`,`creator`,`belong_to_user`,`customer_code`,`follow_up_way` FROM gs_log a left join gs_r_customer_log on a.log_id = gs_r_customer_log.log_id WHERE ( gs_r_customer_log.customer_id= 2212 ) ))) limit 0,10

这条语句哪里错了,半天没找到,错误提示

[SQL]((( SELECT a.log_id,`create_date`,`content`,`creator`,`belong_to_user`,a.customer_code,`follow_up_way` FROM gs_log a left join gs_customer b on a.customer_code = b.customer_code WHERE ( b.customer_code != '' AND b.customer_id = 2212 ) )) union (( SELECT a.log_id,`create_date`,`content`,`creator`,`belong_to_user`,`customer_code`,`follow_up_way` FROM gs_log a left join gs_r_customer_log on a.log_id = gs_r_customer_log.log_id WHERE ( gs_r_customer_log.customer_id= 2212 ) ))) limit 0,10 [Err] 1064 - 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 'union (( SELECT a.log_id,`create_date`,`content`,`creator`,`belong_to_user`,`cus' at line 3
橱窗的光
橱窗的光

全部回复 (2)
数据分析师

这条联合sql语句哪里错了?-PHP中文网问答-这条联合sql语句哪里错了?-PHP中文网问答

围观一下哦,学习一下。

    迷茫

    你括号加太多了,相当于最外面那层是(...) limit 0,10,只能是(...) union (...) limit 0,10

    (( SELECT a.log_id,`create_date`,`content`,`creator`,`belong_to_user`,a.customer_code,`follow_up_way` FROM gs_log a left join gs_customer b on a.customer_code = b.customer_code WHERE ( b.customer_code != '' AND b.customer_id = 2212 ) )) union (( SELECT a.log_id,`create_date`,`content`,`creator`,`belong_to_user`,`customer_code`,`follow_up_way` FROM gs_log a left join gs_r_customer_log on a.log_id = gs_r_customer_log.log_id WHERE ( gs_r_customer_log.customer_id= 2212 ) )) limit 0,10
      最新下载
      更多>
      网站特效
      网站源码
      网站素材
      前端模板
      关于我们 免责声明 Sitemap
      PHP中文网:公益在线PHP培训,帮助PHP学习者快速成长!