加入sql2005中的'= *'在sql2012中不接受 [英] '=* ' in Join sql2005 not accept in sql2012
本文介绍了加入sql2005中的'= *'在sql2012中不接受的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的项目使用sql2005
当我需要加入时
写
选择*
来自A,B
其中
A.ID * = B.ID
''(* =)''在sql2005中没问题
但在sql2012中不接受
我可以做些什么来解决它问题???
解决方案
该运算符在2005版本之后停止。
您仍然可以通过设置COMPATIBILITY_LEVEL
在中的80> SQL Server 2008 R2
。
但你不能在2012年这样做。那里2012年无法做到这一点。
参考 - 外部加入运算符(+) - Oracle到SQL Server迁移 [ ^ ]。
解决方案
而不是尝试ANSI
标准(LEFT OUTER JOIN
),如下所示。
请使用此标准,因为非ANSI标准在2005年之后以及将来的版本中停止使用。
SELECT *
FROM
A
LEFT OUTER JOIN
B
WHERE
A.ID = B.ID
参考 - 查询使用非ANSI外连接运算符(* =或= *)。 [ ^ ]
i have project used sql2005
and when i need to join
write
select *
from A ,B
where
A.ID *= B.ID
''( *= )'' is no problem in sql2005
but in sql2012 is not accept that
what i can Do to solve it problem???
解决方案
This operator is discontinued after version 2005.
You can still use it by setting theCOMPATIBILITY_LEVEL
to 80 inSQL Server 2008 R2
.
But you can''t do it in 2012. There is no way to do this in 2012.
Refer - Outer Join Operator (+) - Oracle to SQL Server Migration[^].
Solution
Instead of this try theANSI
Standard (LEFT OUTER JOIN
) like below.
Please use this standard as the non-ANSI standards are discontinued after 2005 and in future versions also.
SELECT * FROM A LEFT OUTER JOIN B WHERE A.ID = B.ID
Refer - The query uses non-ANSI outer join operators ("*=" or "=*").[^] for examples.
这篇关于加入sql2005中的'= *'在sql2012中不接受的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文