My question is the one stated in the title: "Is the same to use || instead OR and && instead of AND in MYSQL?"
I know that normally you use "AND" or "OR" as comparison operators in SQL but it (seems that) work also "&&" and "||" (like in Java/Javascript etc.) in MYSQL. Is that correct?
Thank you for the aclaration
As others have said, they are indeed equivalent—with the following exceptions as documented under Operator Precedence:
The meaning of some operators depends on the SQL mode:
By default,
||
is a logicalOR
operator. WithPIPES_AS_CONCAT
enabled,||
is string concatenation, with a precedence between^
and the unary operators.By default,
!
has a higher precedence thanNOT
. WithHIGH_NOT_PRECEDENCE
enabled,!
andNOT
have the same precedence.