MySQL: Functions and operators

Source: Internet
Author: User

Expression

    • Except for special processing, expressions containing null are always null.

 

Operator

    • {And | &}, {or | |}, {XOR} {not | !}
    • [Not] between... and...
    • &,~ , |, ^: (BIT) And, reverse, or, different or
    • Case: ANSI standard operator
    • Is [not] {null | true | false}
    • =, >=,>, <=, <, <=> ,! =, <> -- "<=>" Secure equals: The expression "null <=> null" is true1. If one of them is null, false0 is returned.
    • +,-, *,/, %, Div -- Div (floor () is used for integer division, which is safe for bigint; % (mod () is used for remainder.
    • [Not] Like
    • [Not] {rlike | Regexp} -- Regular Expression Pattern Matching
    • >>,<<-- Shifts right and left
    • Binary -- Keyword: Forced String Conversion to binary mode
    • () -- Change the operator priority.
    • Special operation functions

In (), least (), greatest (), coalesce (), interval (), isnull (), strcmp ()...

If () is similar to C? Ternary operators, ifnull () are similar to SQL Server's isnull (), nullif (),

 

 

Type conversion

    • When either side of the comparison is datetime or timestamp, and the other side is a constant, the constant is implicitly converted to datetime or timestamp.
    • The two types are the same and compared according to the same type
    • In other cases, convert to Duble-you may not need to go to the highest level, but the level of tolerance in the middle.
    • Implicit conversion:
    • Display conversion: Cast (), convert (), and binary. Note that the cast function supports the following types: binary (M), char (M), date, datetime, singed, unsigned, decimal (M, D)

 

Special Functions

    • Benchmark () Repeated execution expression
    • Default () gets the default value of the table column
    • Last_day () the last date of a month

.............................

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.