Grouping by year - mySQL -


i have mysql database date field.

i need find years in entries.

for example. if there 5 entries in 2014, , 1 in 2015. 2014 , 2015 output.

i think needs done group by have tried. not sure how complete inner query, think needs done.

select field_id_34 start_date exp_channel_data channel_id = 5 group year(field_id_34) 

can tell me if needs done? , possibly how?

if want know distinct years represented in data, want this:

select distinct year(field_id_34) year exp_channel_data channel_id = 5 

i have no idea field_id_34 is, i'm inferring post date field. also, assume have reasons filter, although not know reasons are. trust can fill in details on end.


Comments

Popular posts from this blog

java - Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved -

Round ImageView Android -

How can I utilize Yahoo Weather API in android -