读书人

mysql没(+)的符号么

发布时间: 2012-10-15 09:45:24 作者: rapoo

mysql没有(+)的符号么?
oracle中语句可以这样写:

SELECT * from
script a,
cust_info b
where a.cust_id=b.cust_id(+)



但是mysql中这样写就报错,是不是能这样用(+)?
那么用什么来代替呢?


附错误信息:

---------------------------
错误
---------------------------
SQL 执行错误 # 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 ')' at line 4
---------------------------
确定
---------------------------


[解决办法]
就是个left join功能吧


select *
from shan_1130 a left join shan_1131 b on a.cust_id=b.cust_id;
[解决办法]
没有吧
[解决办法]
(+) 是ORCLE中的外连接,由于以前的SQL标准并未定义,所以各数据库厂商自行定义了外连接语法。 在SQL新标准中已经定义了外连接使用 left join, right join 。 MYSQL支持新标准。

SQL code
 SELECT * from               script a right join              cust_info b  on a.cust_id=b.cust_id 

读书人网 >Mysql

热点推荐