码迷,mamicode.com
首页 > 数据库 > 详细

SQL- select distinct

时间:2015-06-08 17:16:12      阅读:109      评论:0      收藏:0      [点我收藏+]

标签:

http://www.w3school.com.cn/sql/sql_distinct.asp

SQL SELECT DISTINCT

关键词DISTINCT用于返回唯一不同的值。

语法:

SELECT DISTINCT column_name from table_name

实例:

"Orders"表

CompanyOrderNumber
IBM 3532
W3School 2356
Apple 4698
W3School 6953

select Company from Orders

返回结果:

Company
IBM
W3School
Apple
W3School

select distinct Company from Orders

返回结果:

Company
IBM
W3School
Apple

SQL- select distinct

标签:

原文地址:http://www.cnblogs.com/isister/p/4561241.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!