Personal tools
You are here: Home Les outils logiciels SGBD Oracle oracle - sql - how group a date by year, month...
Log in


Forgot your password?
 

oracle - sql - how group a date by year, month...

How to group by month from Date field using sql

select 

    EXTRACT(YEAR FROM tracing.timestamp_msg) AS year,

    EXTRACT(MONTH FROM  tracing.timestamp_msg) AS month,

    count(id) as count

from tracing

group by

    EXTRACT(YEAR FROM tracing.timestamp_msg),

    EXTRACT(MONTH FROM  tracing.timestamp_msg);

 

Document Actions
« April 2024 »
April
MoTuWeThFrSaSu
1234567
891011121314
15161718192021
22232425262728
2930