MySQL Functions and operators

Source: Internet
Author: User
Tags logical operators mysql functions

Parentheses (...) Compare functions and operators
    • =Equals
    • <=>The null value is secure equal to
    • <>Or!=
    • <=And>
    • expr BETWEEN min AND max
    • COALESCE(value,...)Returns the first non-null value in a later argument list
    • GREATEST(value,...)In the subsequent argument list, return the maximum value
    • expr IN (value1,value2,...)If expr exists in a later argument list, returns 1, otherwise 0
logical operators
    • NOT,!
    • AND,&&
    • OR,||
    • XOR
Process Control Statements
    • IF(expr1,expr2,expr3)Returns EXPR2 if Expr1 is true (expr1<>0&&expr1<>null), otherwise returns EXPR3
    • IFNULL(expr1,expr2)Returns EXPR1 if EXPR1 is not NULL, otherwise returns EXPR2
String functions
    • ASCII(str), returns the value of the leftmost character
    • CHAR_LENGTH(str)Equivalent to CHARACTER_LENGTH(str) , returns the string str length (in characters). Note The LENGTH(str) difference, which returns the string str length, but the unit is in bytes
    • CONCAT(str1,str2,...)Stitching function
    • INSTR(str,substr)Returns the location of the first occurrence of substr in Str
    • LOWER(str)
numeric operators and functions
    • +/-/*//
    • ABS(X)Absolute
    • ACOS(X)
    • FLOOR(X)Returns an integer value that is not greater than X
Date and Time functions
    • ADDDATE(date,INTERVAL expr type)
    • ADDTIME(expr1,expr2)
    • CONVERT_TZ(dt,from_tz,to_tz)Convert time zone
    • DATEDIFF(expr,expr2)Time difference Value
    • DATE_ADD(date,INTERVAL expr type),DATE_SUB(date,INTERVAL expr type)

MySQL Functions and operators

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.