How to query GROUP BY Month in a Year

后端 未结 5 813
情书的邮戳
情书的邮戳 2021-02-01 01:07

I am using Oracle SQL Developer. I essentially have a table of pictures that holds the columns:

[DATE_CREATED(date), NUM_of_PICTURES(int)]

and if I do a select *

5条回答
  •  醉梦人生
    2021-02-01 01:49

    For Oracle:

    select EXTRACT(month from DATE_CREATED), sum(Num_of_Pictures)
    from pictures_table
    group by EXTRACT(month from DATE_CREATED);
    

提交回复
热议问题