加入sql2005中的'= *'在sql2012中不接受

编程入门 行业动态 更新时间:2024-10-26 08:32:26
本文介绍了加入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 the COMPATIBILITY_LEVEL to 80 in SQL 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 the ANSI 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中不接受

本文发布于:2023-07-10 08:19:45,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1089815.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:中不

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!