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