<< previous page   --   table of contents   --   next page >>
| | | | | | | |
  • Return to Table of Contents
  • Table of Contents

    1. General Information
    2. MySQL Installation
    3. Tutorial Introduction
    4. Database Administration
    5. MySQL Optimisation
    6. MySQL Language Reference
    7. MySQL Table Types
    8. MySQL APIs
    9. Extending MySQL

    Chapter 6:  MySQL Language Reference 411 6.3.1.3  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).
     

    Customer Support CentreMySQL Reference Manual

    Web Hosting Services
    UNIX WEB HOSTING
    SUPPORT & FAQ's
    TERMS OF USE
    Domain Services
    DOMAIN REGISTRATION
    MANAGE YOUR ACCOUNT
    SUPPORT & FAQ's
    TERMS OF USE
    SITE MAP
    Home
    Hosting Plans | Domain Registration | About Us | Contact Us | Site Map
    Terms of Use | Privacy Policy | Guarantees
    Merchant Accounts

    SpiritHost - web hosting for spiritual and education sites
    SpiritHit.com - Religious and Spiritual Portal
  • Return to Table of Contents
  • Back to top

  • Web Hosting: Manuals & FAQ's

    1. Unix-Based Web Hosting
    2. Unix Dedicated Servers
    3. Windows Dedicated Servers
    4. CuteFTP User’s Guide
    5. CuteHTML User’s Guide
    6. WS_FTP Pro User's Guide
    7. Miva Order User's Guide
    8. Miva Merchant User's Guide