SQL查询符号“*=”
SELECT
语句中的符号 "*="
代表什么?这对性能有何影响?我们可以用 JOINS
替换它吗?
谢谢 STR
What does the symbol "*="
stand for in a SELECT
statement? How does this affect the performance? Can we replace it with JOINS
?
Thanks
STR
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在某些数据库系统中,
LEFT OUTER JOIN 是一种旧语法:
Microsoft SQL Server,例如 认为自版本以来不推荐使用 *= 语法2005 年。
所以是的,您可以用 JOIN 替换
*=
。事实上,您应该。 (我怀疑它会以任何相关方式影响性能,但您的查询可能会在较新版本的数据库引擎中停止工作。)In some database systems,
is an old syntax for a LEFT OUTER JOIN:
Microsoft SQL Server, for example, considers the *= syntax to be deprecated since version 2005.
So yes, you can replace
*=
with a JOIN. In fact, you should. (I doubt that it affects performance in any relevant way, but your queries might stop working in newer versions of your database engine.)在 SQL 的某些实现中,具有赋值运算符 (
=
) 的 SELECT 语句可用于创建列标题和定义列值的表达式之间的关系。例如:
更多信息:
不幸的是,
=
运算符既可以表示赋值也可以表示相等。对于赋值:
对于相等:
=
是一个相等运算符,规定左侧必须等于右侧。这可能意味着值必须等于子查询返回的结果,或者变量必须等于文字,无论情况如何... a = b 意味着 a 和 b 必须具有相同的值。
In some implementations of SQL, a SELECT statement that has a assignment operator(
=
) can be used to create the relationship between a column heading and the expression that defines the values for the column.So an example might be:
More Info:
Unfortunately the
=
operator can mean both assign and equality.For assignment:
For equality:
The
=
is a equality operator states that the left side must equal the right side.The could mean a value must equal the result returned by a subquery, or a variable must equal a literal, no matter the case... a = b means that a and b have to have the same value.