FROM clause in SQLite

FROM clause in SQLite

The FROM clause can retrieve one or more source tables from the database. Source tables are usually database-named tables, but can also be views or subqueries. More details about subqueries will be introduced later. When multiple source tables are obtained, the JOIN operator will combine the multiple source tables and generate a larger table.

Note: The JOIN operator is judged from left to right. Each JOIN operator will combine two tables into a larger table. Using this principle, a series of JOIN operators can be strung together to achieve three or a combination of more tables.

[Example 3-2] The following will use the JOIN operator to combine the Students and Persons source tables obtained by the FROM clause into a large table. The corresponding SQL statement is as follows:

SELECT * FROM Students JOIN Persons

Run the program, and the execution effect is shown in Figure 3.8.

 

Figure 3.8 Operation effect

Note: The content in Figure 3.9 is the content of the Persons table.

 

Figure 3.9 Persons table

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324725298&siteId=291194637