1.17. SQLite AND/OR operator

发布时间 : 2025-10-25 13:32:47 UTC      

Page Views: 9 views

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. SQLite Multiple comparisons between different operators in a statement provide the possibility.

1.17.1. AND operator

AND Operator is allowed in a 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

The basic syntax of the AND operator with the WHERE clause is as follows:

SELECT column1, column2, columnN FROM table_name WHERE [condition1] AND [condition2]...AND [conditionN]; 

You can use the 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

Hypothetical 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 

Below. 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

OR Operator is also used to combine a SQL statement 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

With 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] 

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.

1.17.6. Example

Hypothetical 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 

Below. 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 
《地理信息系统原理、技术与方法》  97

最近几年来,地理信息系统无论是在理论上还是应用上都处在一个飞速发展的阶段。 GIS被应用于多个领域的建模和决策支持,如城市管理、区划、环境整治等等,地理信息成为信息时代重要的组成部分之一; “数字地球”概念的提出,更进一步推动了作为其技术支撑的GIS的发展。 与此同时,一些学者致力于相关的理论研究,如空间感知、空间数据误差、空间关系的形式化等等。 这恰好说明了地理信息系统作为应用技术和学科的两个方面,并且这两个方面构成了相互促进的发展过程。