for select distinct
时间: 2023-11-12 12:18:54 浏览: 122
SQL select distinct的使用方法
In order to select distinct values from a table in a SQL query, you can use the keyword "DISTINCT" followed by the column(s) you want to retrieve unique values for. Here's an example:
```sql
SELECT DISTINCT column_name
FROM table_name;
```
Replace "column_name" with the actual column name you want to retrieve distinct values for, and "table_name" with the name of the table you are querying. This query will return only the unique values from the specified column.
阅读全文