Operators in the 6-01t-sql

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

arithmetic operators : + 、-、 *,/,%.

Assignment operator: =

logical operators : And, or, not.

comparison operators :>,<,<=,>=,<>, =,! =

Join operator : "+".

Precedence of the operator:

> Arithmetic operators > Comparison operators > Logical operators > Join operators > Assignment operators.

Arithmetic operators:

The result of the SELECT 3+4 as plus-  the sum goselect 5/2 as results in the left and right sides of the--2.5,/are integers, and the result is an integer goselect 5.0/2 as  result-a non-integer on both left and right, and the result is not an integer GOSE Lect 5%2 as modulus 5 inside there are two 2, the more out of this is called Die Go

Assignment operators:

--assigns the right value of the equal sign to the left variable declare  @age int SET  @age =18select @ageGO

Comparison operators:

Declate  @X int,@y intset @x=8set @y=10if @x>[email protected]select ' @X value greater than @y ' ELSE SELECT ' @y value big ' GO

Logical operators:

--logical operator And,or,not--and the left and right results are true when the result is true--or around the result has a true time, the result is true--not--not>and>orif (3>5 OR 6> 3 and not 6>4 ) Select ' True ' (true) ' Elseselect ' false (false) "GO

Join operators:

Declter @COLOR VARCHAR (4) SET @COLOR = ' white ' SELECT ' my favorite color ' [email protected]go

  

Operators in the 6-01t-sql

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.