# **sql distinct 语句**
---
select distinct 语句被使用返回不同的值
---
### **select distinct 语句**
---
在一张表中,一列可能包含重复的值,有时你想列出不同的值。
distinct 关键词被使用 返回不同的值
---
>SELECT DISTINCT column_name,column_name
FROM table_name;
---
### **select distinct 案例**
下面这条sql 语句从customers 表中筛选出 city列中 不同的值
---
>select distinct city from customers;
---
- sql文档
- sql简介
- sql语法
- select
- distinct
- where
- and & or
- order by
- insert into
- update
- delete
- injection
- select top
- like
- wildcards
- in
- between
- aliases
- joins
- inner join
- left join
- union
- select into
- insert into select
- create db
- create table
- constraints
- not null
- unique
- primary key
- foreign key
- check
- sql default
- create index
- create index
- drop
- alter
- auto increament
- views
- dates
- null values
- null functions
- data types
- db data types
- SQL Functions
- avg
- count
- first
- last
- max
- min
- sum
- group by
- having
- mid
- len
- round
- now
- format
- quick ref
- hosting
- sql quiz