mysql select from where when
时间: 2024-02-23 14:33:21 浏览: 100
The "SELECT FROM WHERE" clause is used in MySQL to retrieve data from a table based on certain conditions.
Here is an example of how to use the SELECT FROM WHERE clause in MySQL:
```
SELECT column1, column2, ...
FROM table_name
WHERE condition;
```
- "column1, column2, ..." are the columns that you want to retrieve data from.
- "table_name" is the name of the table that you want to retrieve data from.
- "condition" is the condition that you want to apply to retrieve data.
For example, to retrieve all the rows from the "users" table where the age is greater than or equal to 18, you can use the following query:
```
SELECT * FROM users WHERE age >= 18;
```
This will retrieve all the columns and rows from the "users" table where the age is greater than or equal to 18.
阅读全文