某些版本的mysql不支持join语句?急!!!

delphi_compiler 2007-08-08 10:08:12
select c.contname, s.totpts from chartercommittees cc left outer join stats s on s.chartercommid = cc.chartercommid
and s.we = '2007-08-02 00:00:00' join conts c on cc.cccontid = c.cccontid Where cc.cccontid not in (13, 14)
这个语句在我本地mysql运行很正常,放客户服务器上就通不过,报sql语法错误You have an error in your SQL syntax near 'on cc.cccontid = c.cccontid Where cc.cccontid not in (13, 14)
必须改成select c.contname, s.totpts from chartercommittees cc,conts c left outer join stats s on s.chartercommid = cc.chartercommid
and s.we = '2007-08-02 00:00:00' Where cc.cccontid = c.cccontid and cc.cccontid not in (13, 14) 才可以用
我本地mysql是4.0.26,客户server的是mysql 3.23,我觉得可能与mysql设置有关,大家以前遇到过这个问题吗?
...全文
244 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
delphi_compiler 2007-08-09
  • 打赏
  • 举报
回复
顶!难道没人知道吗?
懒得去死 2007-08-08
  • 打赏
  • 举报
回复
升级你的MYSQL。
wx红杉树 2007-08-08
  • 打赏
  • 举报
回复
mysql 3.22以下版本不支持子查询, 但所有的子查询都可以使用
LEFT JOIN 或 and语句替代. 但mysql 3.23需要安装补丁,或升级该版本.
delphi_compiler 2007-08-08
  • 打赏
  • 举报
回复
mysql 3.22以下版本不支持子查询, 但所有的子查询都可以使用
LEFT JOIN 或 and语句替代. 但mysql 3.23需要安装补丁,或升级该版本.
-------------------------------------------------------------------------
我的语句没有用到子查询呀

56,677

社区成员

发帖
与我相关
我的任务
社区描述
MySQL相关内容讨论专区
社区管理员
  • MySQL
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧