<< 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 429 -> "C" In  MySQL  versions  prior  to  Version  3.22.5,  you  can  use  MAX()  instead  of GREATEST. DEGREES(X) Returns the argument X, converted from radians to degrees: mysql> SELECT DEGREES(PI()); -> 180.000000 RADIANS(X) Returns the argument X, converted from degrees to radians: mysql> SELECT RADIANS(90); -> 1.570796 TRUNCATE(X,D) Returns the number X, truncated to decimals.  If is 0, the result will have no decimal point or fractional part: mysql> SELECT TRUNCATE(1.223,1); -> 1.2 mysql> SELECT TRUNCATE(1.999,1); -> 1.9 mysql> SELECT TRUNCATE(1.999,0); -> 1 mysql> SELECT TRUNCATE(-1.999,1); -> -1.9 Starting from MySQL 3.23.51 all numbers are rounded towards zero. If is negative, then the whole part of the number is zeroed out: mysql> SELECT TRUNCATE(122,-2); -> 100 Note  that  as  decimal  numbers  are  normally  not  stored  as  exact  numbers  in computers, but as double values, you may be fooled by the following result: mysql> SELECT TRUNCATE(10.28*100,0); -> 1027 The above happens because 10.28 is actually stored as something like 10. 6.3.4  Date and Time Functions See  Section 6.2.2 [Date and time types], page 394  for a description of the range of values each type has and the valid formats in which date and time values may be speci ed. Here is an example that uses date functions.  The following query selects all records with a date_col value from within the last 30 days: mysql> SELECT something FROM tbl_name WHERE TO_DAYS(NOW()) - TO_DAYS(date_col) <= 30; DAYOFWEEK(date) Returns the weekday index
     

    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