<< 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 423 mysql> SELECT "a" = "A"; -> 1 mysql> SELECT BINARY "a" = "A"; -> 0 BINARY string is a shorthand for CAST(string AS BINARY).  See Section 6.3.5 [Cast Functions], page 437.  BINARY was introduced in MySQL Version 3.23.0. Note that in some context MySQL will not be able to use the index eciently when you cast an indexed column to BINARY. If you want to compare a blob case-insensitively you can always convert the blob to upper case before doing the comparison: SELECT 'A' LIKE UPPER(blob_col) FROM table_name; We plan to soon introduce casting between di erent character sets to make string compar- ison even more exible. 6.3.3  Numeric Functions 6.3.3.1  Arithmetic Operations The usual arithmetic operators are available.  Note that in the case of `-', `+', and `*', the result is calculated with BIGINT (64-bit) precision if both arguments are integers!  If one of the argument is an unsigned integer, and the other argument is also an integer, the result will be an unsigned integer.  See Section 6.3.5 [Cast Functions], page 437. + Addition: mysql> SELECT 3+5; -> 8 - Subtraction: mysql> SELECT 3-5; -> -2 * Multiplication: mysql> SELECT 3*5; -> 15 mysql> SELECT 18014398509481984*18014398509481984.0; -> 324518553658426726783156020576256.0 mysql> SELECT 18014398509481984*18014398509481984; -> 0 The result of the last expression is incorrect because the result of the integer multiplication exceeds the 64-bit range of BIGINT calculations. / Division: mysql> SELECT 3/5; -> 0.60 Division by zero produces a NULL result:
     

    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