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);