Forum Stats

  • 3,837,072 Users
  • 2,262,223 Discussions
  • 7,900,198 Comments

Discussions

Oracle DBA - Group by Date as Month

SANPAT
SANPAT Member Posts: 1,111 Silver Badge

Dear Friends

I need to run the query where i need to group the data based on Month and year from the entry_date. Entry date is stored as DD-MM-YYYY HH24:MM:SS in date format.

Query as :

select to_char(entry_date,'MM YYYY),sum(qty)qty FROM TABLE GROUP BY TO_CHAR(ENTRY_DATE,'MM YYYY),QTY

it shows all the records. we need a result all the records should get group for the particular month and sum qty .

Kindly suggest.

Sanjay

Answers