2011-07-27 54 views

回答

43
SELECT DISTINCT YEAR(created) FROM table 
+0

大,非常感謝! – tvgemert

+0

爲我工作! – youssman

2
SELECT EXTRACT(year from created) as year 
FROM your_table 
GROUP BY year 

應該工作:)在這些線路上

3

的東西應該工作(注意:提前未經測試的代碼)

select year(created) as year, count(*) as count from table_name group by year 

這也給的每年記錄數。

+0

好的補充,謝謝。 – tvgemert

0
Select 
EXTRACT(year from your_column_name) as MYEAR from your_table_name 
group by EXTRACT(year from your_column_name) 

以上爲我工作...

1

SELECT DISTINCT YEAR(日期)AS MYR FROM YOUR_DBF_HERE ORDER BY MYR

相關問題