2012-03-15 74 views
-6

我有一個表中有相同的日期前行。不同日期列

 Date 
    -------------- 
1/02/2012 
1/02/2012 
1/02/2012 

我怎樣才能區分他們,並得到只有一個行結果前。 01/02/2012

回答

7

這真的是很簡單的,你可以這樣做:

SELECT DISTINCT [Date] 
FROM YourTable 

或者:

SELECT [Date] 
FROM YourTable 
GROUP BY [Date] 
5
SELECT [Date] FROM tablename GROUP BY [Date] 
1
SELECT Date 
FROM [TableName] 
GROUP BY Date 

只給了不同的答案。 :)

1

用途:select distinct Date from TableName