Skip to Main Content

SQL Developer

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Query returning empty months

Javier PMar 10 2022

Hi all,

I have this query that returns the production of the last 12 months.
This is the query:

select
    null
  , sum(f.comision)         value
  , trunc(f.efectiva, 'MM') label
from
    risk_facturas f
where
    f.efectiva >= add_months(trunc(sysdate), -13) and f.efectiva < trunc(sysdate) + 1
and f.organizacion_id = :APP_GET_ORGANIZACION_ID
group by
    trunc(f.efectiva, 'MM')

How can I get a line for every month no matter if it has any production or is just 0? Can this be done?
Thanks for the help!
Javier

This post has been answered by Solomon Yakobson on Mar 12 2022
Jump to Answer

Comments

Post Details

Added on Mar 10 2022
18 comments
108 views