select 0 if null

  • Thread starter Thread starter xarrisx
  • Start date Start date
X

xarrisx

I have this statement

select prod_id, sum(prod_price)
from sells
group by prod_id

sells
----------------------------------------
PROD_ID PROD_PRICE
1 100
2 50
1 200
2 50
3
1 50

-----------------------------------------------
results:
1 350
2 100

PRODUCT 3 is not selected

I want to know if there is a way to get a value of 0 when PROD_PRICE is
null

results:
1 350
2 100
3 0

I AM USING ACCESS
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top