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
« May 2024 »
May
MoTuWeThFrSaSu
12345
6789101112
13141516171819
20212223242526
2728293031