Arithmetic operators:
Use Select to achieve subtraction, mold operation, etc.:
SELECT 6+4addition operation,6-4subtraction operation,6*4multiplication operation,6/2division operation,6Div2division operation,6%4die-finding operation,6MOD4Die-finding operation;
In addition to this, you can directly manipulate the properties in the table:
SELECT ename employee, Sal monthly salary, Sal* Annual salary from T_employee;
Comparison operators:
Returns 1 if the condition is met, otherwise returns 0;
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;
In addition, you can use it in the WHERE statement:
Logical operators: You can combine the conditions with a logical operation in where.
True and null vs. or null
SELECT 3 and 4, 0 and 4, 0 and NULL, 3 and NULL, 3 && 4, 0 && 4, 0 && NULL, 3 && NULL;
SELECT from where col1=and=or col3>
Bitwise operators:
The bin function can view the binary:
SELECT 5 & 6 , BIN (5&6) binary number, 4&5& 6, BIN (4&5&6) binary number;
SELECT 3Xor4, 0Xor0, NULLXorNULL, 0Xor4, 0XorNULL, 3XorNULL;
NULL and any data XOR return null
SQL operator Operations