SQL comment, operator, and wildcard characters

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

An annotation is an explanation or description of the code;

Operators are important components of the Transact-SQL language, and common operators include arithmetic operators, assignment operators, comparison operators, logical operators, and so on.

Wildcard characters are%, _ (underscore), [], [^].

Annotation characters

In Transact-SQL, you can use two types of comment characters:

    • An ANSI standard annotation (--) for single-line comments, such as those added by the following SQL statement
 Use -- Open Data Table

The same program annotation symbol as the C language, i.e. "/*", "*/"

The shortcut key to annotate the selected row at once is CTRL + Shift +c; the shortcut key for canceling multiple lines of comment at once is CTRL + Shift +r.

Comparison operators

>,<,=,>=,<=,<>.

The result of the comparison operator is a Boolean data type with True,false and UNKNOW3 values.

logical operators

Logical operators, like comparison operators, return Boolean data types with a value of true or False

Operators are:all,and,any,between,exists,in,like,not,or,some

Bitwise operators

The operand of a bitwise operator can be an integer type or a binary data type

Operator:&,|,^ (bitwise mutex), ~

Join operators

+

Wildcard characters

Matches any single character in the specified range or within the set specified by the square brackets.

Wildcard Description Example
% Any character that contains 0 or more characters "loving%" can be said: "Loving", "Loving You", "Loving?" ”
_ (Underline) Any single character "Loving_" can be said: "LOVINGC". followed by only one character
[] Any single character in the specified range ([a~f]) or collection ([abcdef]) [0~9]123 denotes a character starting with any character between 0~9 and ending with ' 123 '
[^] Any single character that does not belong to the specified range ([a~f]) or collection ([abcdef]) [^0~5]123 means a character that does not start with any one character between 0~5, but ends with "123"

SQL comment, operator, and wildcard characters

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.