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
« March 2024 »
March
MoTuWeThFrSaSu
123
45678910
11121314151617
18192021222324
25262728293031