Software Outsourcing, Offshore Software Development, Offshore Outsourcing Services, IT Outsourcing, Offshore Development
MySQL manual Offshore Software Outsourcing and Programming, IT Outsourcing Offshore Software Development  
Call Us Today: 1-800-678-9001
Offshore Software Outsourcing and Programming, IT Outsourcing Offshore Software Development

Home / Technical Support / MySQL

Key Offerings:

B2B and B2C E-Business Solutions

Offshore Software Development Outsourcing

Strategic Consulting

Offshore Software Outsourcing

About ALTOROS: ALTOROS Systems is headquartered in Tampa, Florida and maintains an office near Boston, Massachusetts and technology development center in Belarus and Russia. ALTOROS specializes on providing value-added e-commerce and web-based software development and offshore software outsourcing services to emerging enterprises helping them successfully plan and implement business initiatives.

Contact Us for more information.

Node: Logical Operators, Next: Control flow functions, Prev: Comparison Operators, Up: Non-typed Operators
Logical Operators
 
All logical operators evaluate to 1 (TRUE), 0 (FALSE) or NULL (unknown, which is in most cases the same as FALSE):
 
 
 
NOT
!
Logical NOT. Evaluates to 1 if the operand is 0, otherwise evaluates to 0.  Exception: NOT NULL evaluates to NULL:
mysql> SELECT NOT 1;
        -> 0
mysql> SELECT NOT NULL;
        -> NULL
mysql> SELECT ! (1+1);
        -> 0
mysql> SELECT ! 1+1;
        -> 1
The last example produces 1 because the expression evaluates the same way as (!1)+1.
 
 
OR
||
Logical OR. Evaluates to 1 if either operand is not 0 and not NULL:
mysql> SELECT 1 || 0;
        -> 1
mysql> SELECT 0 || 0;
        -> 0
mysql> SELECT 1 || NULL;
        -> 1
 
 
AND
&&
Logical AND. For non-NULL operands, evaluates to 1 if both operands are non-zero and to 0 otherwise.  Produces NULL if either operand is NULL:
mysql> SELECT 1 && 1;
        -> 1
mysql> SELECT 1 && 0;
        -> 0
mysql> SELECT 1 && NULL;
        -> NULL
 
 
XOR
Logical XOR. For non-NULL operands, evaluates to 1 if only one of the operators is non-zero.  Produces NULL if either operand is NULL:
mysql> SELECT 1 XOR 1;
        -> 0
mysql> SELECT 1 XOR 0;
        -> 1
mysql> SELECT 1 XOR NULL;
        -> NULL
 
a XOR b is equal to (a AND (NOT b)) OR ((NOT a) and b).
 
Offshore Software Outsourcing company Russia Florida Massachusetts Boston Belarus, Offshore Software Development Services, Offshore Programming and IT OutsourcingOffshore Development, Programming  Services, Tampa FL Russia, E-commerce, Database, CRM, Financial Insurance Health Care Real EstateOffshore Software Development Services, Software Outsourcing Russia
HOME PAGE, Offshore Software Outsourcing Company, offshore IT outsourcing services, offshore 
software development Russia Massachusetts Florida New York CT VT RI software development