How to query GROUP BY Month in a Year

后端 未结 5 867
情书的邮戳
情书的邮戳 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:31

    You can use:

        select FK_Items,Sum(PoiQuantity) Quantity  from PurchaseOrderItems POI
        left join PurchaseOrder PO ON po.ID_PurchaseOrder=poi.FK_PurchaseOrder
        group by FK_Items,DATEPART(MONTH, TransDate)
    

提交回复
热议问题