sqlite
Database; use; embedded relational database
indexed
英['ɪndekst] 美[ 'ɪndekst]
adj.Indexed, indexed, linked to the living index (or price index)
by
British [baɪ] American [baɪ]
prep.beside...;expression method;due to;passing through
adv.passing;used when expressing reservation or preservation;short visit
SQLite Indexed By function syntax
Function:The "INDEXED BY index-name" clause specifies that a named index must be needed to find the value in the previous table. If the index name index-name does not exist or cannot be used in the query, then preparation of the SQLite statement fails. The "NOT INDEXED" clause specifies that no index is used when accessing the preceding table (including implicit indexes created by UNIQUE and PRIMARY KEY constraints). However, even if "NOT INDEXED" is specified, the INTEGER PRIMARY KEY can still be used to find entries.
Syntax: The following is the syntax of the INDEXED BY clause, which can be used with DELETE, UPDATE or SELECT statements:
SELECT|DELETE|UPDATE column1, column2. ..
INDEXED BY (index_name)
table_name
WHERE (CONDITION);
SQLite Indexed By function example
表 COMPANY,我们将创建一个索引,并用它进行 INDEXED BY 操作。 sqlite> CREATE INDEX salary_index ON COMPANY(salary); sqlite> 现在使用 INDEXED BY 子句从表 COMPANY 中选择数据,如下所示: sqlite> SELECT * FROM COMPANY INDEXED BY salary_index WHERE salary > 5000;