'AND' 之间的区别和'&&'在 SQL 中

发布于 2024-09-30 17:56:12 字数 70 浏览 1 评论 0原文

SQL 解释逻辑运算符 AND&& 的方式有区别吗?

Is there a difference in the way SQL interprets the logical operators AND and &&?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

深者入戏 2024-10-07 17:56:12

AND 是标准 SQL

&& 是专有语法

AND is Standard SQL

&& is proprietary syntax

忆梦 2024-10-07 17:56:12

对于mySQL:手册并没有说它是明确的,但它们被列为相同的:

与、&&

逻辑与。如果所有操作数均非零且不为 NULL,则计算结果为 1;如果一个或多个操作数为 0,则计算结果为 0,否则返回 NULL。

运算符优先级页面也没有进行区分。

For mySQL: The manual is not saying it explicitly, but they are listed as identical:

AND, &&

Logical AND. Evaluates to 1 if all operands are nonzero and not NULL, to 0 if one or more operands are 0, otherwise NULL is returned.

The operator precedence page also makes no distiction.

青萝楚歌 2024-10-07 17:56:12

如果您使用 PostgreSQL,则“&&”表示重叠(有共同元素):

示例:ARRAY[1,4,3] &&数组[2,1]

https://www.postgresql .org/docs/9.1/static/functions-array.html

If you're working with PostgreSQL, '&&' means overlap (have elements in common):

example: ARRAY[1,4,3] && ARRAY[2,1]

https://www.postgresql.org/docs/9.1/static/functions-array.html

疑心病 2024-10-07 17:56:12

根据此页面 http://msdn.microsoft.com/en-us/library /bb387129.aspx 它们在 SQL Server 中具有相同的功能。

MySql 对这个主题有这样的说法 http://dev.mysql .com/doc/refman/5.0/en/logic-operators.html

According to this page http://msdn.microsoft.com/en-us/library/bb387129.aspx they have the same functionality in SQL Server.

MySql has this to say on the subject http://dev.mysql.com/doc/refman/5.0/en/logical-operators.html

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文