SQLite
Of AND And OR Operator is used to compile multiple conditions to narrow down the
SQLite
The data selected in the statement. These two operators are called concatenation operators.
These operators are the same. AND Operator is allowed in a The basic syntax of the AND operator with the WHERE clause is as follows: You can use the Hypothetical Below. OR Operator is also used to combine a SQL statement With You can use the OR operator to combine N quantities of conditions. The action that the SQLite statement needs to perform is either a transaction or a query, as long as any OR-delimited condition is TRUE. Hypothetical Below.
SQLite
Multiple comparisons between different operators in a statement provide the possibility. 1.17.1. AND operator ¶
SQL
Statement of
WHERE
The existence of multiple conditions in the clause. When using the AND operator, the entire condition is true (true) only if all conditions are true. For example, only if both condition1 and condition2 are true [condition1] AND [condition2] True (true). 1.17.2. Grammar ¶
SELECT column1, column2, columnN
FROM table_name
WHERE [condition1] AND [condition2]...AND [conditionN];
AND
Operator to combine N quantity conditions.
SQLite
Statement is to be performed, whether it is a transaction or a query, all by the
AND
The condition of separation must be true (TRUE). 1.17.3. Example ¶
COMPANY
The table has the following records:ID NAME AGE ADDRESS SALARY
---------- ---------- ---------- ---------- ----------
1 Paul 32 California 20000.0
2 Allen 25 Texas 15000.0
3 Teddy 23 Norway 20000.0
4 Mark 25 Rich-Mond 65000.0
5 David 27 Texas 85000.0
6 Kim 22 South-Hall 45000.0
7 James 24 Houston 10000.0
SELECT
Statement lists the
AGE
Greater than or equal to 25 且 All records with a salary greater than or equal to 65000.00:sqlite> SELECT * FROM COMPANY WHERE AGE >= 25 AND SALARY >= 65000;
ID NAME AGE ADDRESS SALARY
---------- ---------- ---------- ---------- ----------
4 Mark 25 Rich-Mond 65000.0
5 David 27 Texas 85000.0
1.17.4. OR operator ¶
WHERE
Multiple conditions in a clause. Use
OR
Operator, as long as any one of the conditions is true, the entire condition is true. For example, whenever one of condition1 or condition2 is true (true) [condition1] OR [condition2] True (true). 1.17.5. Grammar ¶
WHERE
Of the clause
OR
The basic syntax of the operator is as follows:SELECT column1, column2, columnN
FROM table_name
WHERE [condition1] OR [condition2]...OR [conditionN]
1.17.6. Example ¶
COMPANY
The table has the following records:ID NAME AGE ADDRESS SALARY
---------- ---------- ---------- ---------- ----------
1 Paul 32 California 20000.0
2 Allen 25 Texas 15000.0
3 Teddy 23 Norway 20000.0
4 Mark 25 Rich-Mond 65000.0
5 David 27 Texas 85000.0
6 Kim 22 South-Hall 45000.0
7 James 24 Houston 10000.0
SELECT
Statement lists the
AGE
Greater than or equal to 25 或 All records with a salary greater than or equal to 65000.00:sqlite> SELECT * FROM COMPANY WHERE AGE >= 25 OR SALARY >= 65000;
ID NAME AGE ADDRESS SALARY
---------- ---------- ---------- ---------- ----------
1 Paul 32 California 20000.0
2 Allen 25 Texas 15000.0
4 Mark 25 Rich-Mond 65000.0
5 David 27 Texas 85000.0