The difference between 'AND' and '&&' in SQL

社会主义新天地 提交于 2019-11-27 15:02:27

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.

AND is Standard SQL

&& is proprietary syntax

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

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!