Skip to Main Content

SQL & PL/SQL

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!

joining two table with sum. The sum has should gives me zero if null

1049879Jul 13 2017 — edited Jul 20 2017

I have two tables.

    TABLE A :

    I_NO , I_NAME

    1      A

    2      B

    3      C

    4      D

    5      F

    TABLE B :

    THE_DATE , I_NO , THE_MONY

    01-JAN-2017  1       50

    01-FEB-2017  2       50

    01-APR-2017  3       50

    01-SEP-2017  2       50

    01-APR-2017  1       50

I would like to create a query That Joining the two tables in which gives me all the I_NO from TABLE A and the sum of THE_MONY with DATE <= 01-FEB-2017

If there is a null value in the sum the query should give me 0 for the sum.

The result should be like the followings:

    1      50

    2      50

    3      0

    4      0

    5      0

This post has been answered by Nimish Garg on Jul 13 2017
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 10 2017
Added on Jul 13 2017
6 comments
496 views