select statement

X

xarrisx

My table 'PRODUCTS'

PROD_ID QUANTITY
1 10
2 NULL
3 20
----------------------------------------
i want a statement to select all from PRODUCTS but if QUANTITY is NULL
then QUANTITY should be 0

-----------------
The result i want should be
PROD_ID QUANTITY
1 10
2 0
3 20
 
S

Sylvain Lafontaine

Use the function IsNull in your select statement:

SELECT Prod_Id, IsNull (Quantity, 0) as Quantity From ...

S. L.
 

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

Top