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

前端 未结 4 1473
日久生厌
日久生厌 2020-12-03 16:55

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

相关标签:
4条回答
  • 2020-12-03 17:37

    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

    0 讨论(0)
  • 2020-12-03 17:45

    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.

    0 讨论(0)
  • 2020-12-03 17:48

    AND is Standard SQL

    && is proprietary syntax

    0 讨论(0)
  • 2020-12-03 17:48

    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

    0 讨论(0)
提交回复
热议问题