不选择重复数据SQL

时间:2012-01-18 21:55:09

标签: php sql

我有一个看起来像这样的表:

 Make  | Model
 --------------
 Ford  | Bronco
 Ford  | Taurus
 Honda | Accord 
 Ford  | Thunderbird
 Saab  | 900

我需要一个SQL语句才能从Ford列中仅输出HondaSaabMake

4 个答案:

答案 0 :(得分:4)

SELECT DISTINCT Make 
    FROM YourTable
    ORDER BY Make;

答案 1 :(得分:2)

select distinct Make from table_name

答案 2 :(得分:2)

SELECT DISTINCT Make
FROM YourTable

答案 3 :(得分:2)

SELECT DISTINCT Make
FROM MyTable

就是这样。