MySQL using the MySQL operator

Source: Internet
Author: User
Tags bitwise operators

MySQL operator: 1. Arithmetic operator subtraction and modulo select 6+4addition operation,6-4subtraction operation,6*4multiplication operation,6/2division operation,6 DIV 2division operation,6%4die-finding operation,6 MOD 4die-finding operation;2. Comparison operator equals, greater than, less than, equal to, less than or equal to, not equal to (<>), remember unequal so <>select 1=1numerical comparisons,' Cjgong ' = ' cjgong 'string comparisons,1+2=3+3expression comparison,1<=>1numerical comparisons,' Cjgong ' <=> ' Cjgong 'string comparisons,1+2<=>3+3expression comparison;There is also a regexp, regular expression. ^ matches the beginning of the string to the end of the string. Matches any one of the characters in the string [charset] matches any one of the characters in the character set [^ charset] matches any character in the character set, str1|str2| STR3 match str1,str2, and any of the strings in STR3 * match characters, contain 0 and one (can be used to match a character before there are multiple characters: for example A*g, the character G before there is more than a, because contains 0, so does not exist also return 1) + match character, contains a ( Whether there are more than one character before a character can be matched: for example, a+g, if there is more than one a before the character G, because there is at least 1, so there is no return 0) the string [n] string appears n times the string (m,n) string appears at least m times, up to N times 3. Logical operator and (& &), or (|), SELECT 3 and 4, 0 and 4, 0 and NULL, 3 and NULL, 3 && 4, 0 && 4, 0 &A mp;& NULL, 3 && NULL, TRUE and null and results are null;4. Bitwise operators: Use bin to view binary,& operators directly, convert both sides to binary, and operate select 5 &6, BIN (5&6)Binary number,4&5&6,bin (4&AMP;5&AMP;6)binary number;XOR (same as 0, different to 1, null for result) SELECT 3 XOR 4, 0 XOR 0, null XOR NULL, 0 XOR 4, 0 XOR null, 3 XOR null, left shift right , first convert the operand to binary, left to the right to 0, right to the left to fill 0SELECT BIN (5)Binary number,5<<4,bin (5&LT;&LT;4)Binary number,5>>1,bin (5>>1)binary number;

MySQL 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.