MySQL Database learning 12 using the MySQL operator

Source: Internet
Author: User
Tags arithmetic operators bitwise logical operators

12.1 Arithmetic Operators

+ - * / (DIV) % (MOD)

12.2 Comparison Operators

> < = <=> != <> >= <=  between and  exists in the specified range is null      for  empty           in exists in the specified collection          like Wildcard match REGEXP       Regular expression matching

The so-called regular expression is the pattern to match a class of strings.

Pattern character Meaning
^ Match the beginning of a string
$ Match the end of a string
. Match any one of the characters in the string
[Character Set] Match any one of the characters in the character set
[^ Character Set] Match any character in a character set
Str1|str2|str3 Match any of the strings in str1, STR2, STR3
* Match character, containing 0 or any of
+ Match characters, including at least 1
string {N} String appears consecutively n times
string {m,n} The string appears continuously at least m times, up to N times

12.3 Logical operators

 and (&&)  returns 1 if all operands are not 0 and is not NULL, any one of the operands is 0 o'clock, returns 0, any one operand is null and no operand is 0 o'clock, and Null is returned.  OR(| |     all operands have any one operand not 0, return 1, all operands are 0, return 0, All operands do not contain a number other than 0, but contain null, and the result returns null.  not(!)   single-action digit operator  Returns 1 if the operand is not 0 digits, or 1 if the operand is 0, or null if the operand is null. XOR      If one operand is 0 and the other operand is not 0, returns 1, the operand is 0 or the same as a non 0 number, returns 0, or null if the operand contains null. 

12.4-bit operators

&     Bitwise-and | Bitwise      or ~ bitwise     Inverse single-digit    operator ^ bitwise     xor << Bitwise   left shift     right 0>>  bitwise Right SHIFT     left 0

MySQL represents a constant with 8 bytes (64 bits).

MySQL Database learning 12 using the MySQL operator

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.