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!

Sum is giving wrong result

User_J6TB7Dec 29 2021

Hi All,
We are trying to run sum on a column of a table.
select sum(nvl(GROSS_SALES_PRODUCT_QUANTITY,0)) from dsstrd where calendar_number=2459573 ;
Its giving result: 795847
select sum(GROSS_SALES_PRODUCT_QUANTITY) from dsstrd where calendar_number=2459573 ;
Its giving result-- 506813
There is no null value on GROSS_SALES_PRODUCT_QUANTITY in table . Could you please suggest what could be the issue?
Appreciate your help on this. Thank you!!

This post has been answered by User_J6TB7 on Dec 30 2021
Jump to Answer
Comments
Post Details
Added on Dec 29 2021
15 comments
2,969 views