Operator priority
When a complex expression has multiple operators, the operator priority determines the order of Operation execution. The execution sequence may seriously affect the obtained values.
Operators have the following priority levels. Evaluate a higher-level operator before a lower-level operator.
+ (Positive),-(negative ),~ (By bit not)
* (Multiplication),/(Division), % (Modulo)
+ (Plus), (+ series),-(minus)
=,>, <, >=, <=, <> ,! =,!>, ! <Comparison operator
^ (Bitwise OR), & (bitwise AND), | (bitwise OR)
Not
And
All, any, between, in, like, Or, some
= (Assign value)
Not commonly used binary operators. They are also of unique use in some aspects, such as positive ^ positive = positive ......
-- Create a table with the same structure as one or more tables
Select * into [new table] from [source table] where 1 = 0
/** // * The table created in this mode only has the basic structure and no additional information such as the primary key */
/** // * Some special sorting methods */
-- 1.
Select * from table
Order
Case ID
When 4 then 1
When 5 then 0
End
-- 2.
Select * from table
Order by ID % 5
-- 3.
Select * from table
Order by right (ID, 3)
-------------------------------
/** // * In short, there are some flexible ideas */