SQL statements for linux-IN and SQL-in
In SQLINThis command. This page describes one of the commands --WHEREThe related situation. In this usage, we know at least one value we need in advance, and we put all these valuesINThis clause.INThe command syntax is as follows:
SELECT "column name"
FROM "table name"
WHERE "column name" IN ('value 1', 'value 2 ',...);
There can be one or more values in the arc, and different values are separated by commas. The value can be a number or a text. If there is only one value in the arc, this clause is equal
WHERE "column name" = 'value 1'
For exampleStore_InformationThe table lists all documents containing gulos Angeles or San Diego,
Store_InformationTable
| Store_Name |
Sales |
Txn_Date |
| Los Angeles |
1500 |
05-Jan 1999 |
| San Diego |
250 |
07-Jan-1999 |
| San Francisco |
300 |
08-Jan 1999 |
| Boston |
700 |
08-Jan 1999 |
Let's get,
SELECT *
FROM Store_Information
WHERE Store_Name IN ('Los Angeles', 'san Diego ');
Result:
| Store_Name |
Sales |
Txn_Date |
| Los Angeles |
1500 |
Jan-05-1999 |
| San Diego |
250 |
Jan-07-1999 |
The test results for Linux are as follows:
Reprinted, please note: Xiao Liu