Is there a difference in the way SQL interprets the logical operators AND
and &&
?
"&" is used only when it is used between two nouns. for example: Rita & Gita went out to play. "and" is used when you want to join two sentences.
And/or (sometimes written and or) is an English grammatical conjunction used to indicate that one or more (or even all) of the cases it connects may occur. It is used as an inclusive or (as in logic and mathematics), because saying "or" in spoken language (or writing "or") might be inclusive or exclusive.
What is an ampersand? An ampersand (&) is a typographical symbol that is rarely used in formal writing. It is read aloud as the word and and is used as a substitute for that word in informal writing and in the names of products or businesses.
Colons and semicolons are two types of punctuation. Colons (:) are used in sentences to show that something is following, like a quotation, example, or list. Semicolons (;) are used to join two independent clauses, or two complete thoughts that could stand alone as complete sentences.
AND
is Standard SQL
&&
is proprietary syntax
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With