2011-07-27 18 views

Respuesta

43
SELECT DISTINCT YEAR(created) FROM table 
+0

Grandes, muchas gracias! – tvgemert

+0

¡Funcionó para mí! – youssman

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

debería funcionar :)

3

Algo sobre estas líneas debería funcionar (Advertencia: no probado por delante código)

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

Esto también dará número de registros de cada año.

+0

Agradable además, gracias. – tvgemert

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

Lo anterior trabajó para mí ...

1

seleccionar el año DISTINCT (Fecha) AS MYR DE YOUR_DBF_HERE ORDER BY MYR

Cuestiones relacionadas