문제

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

도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top