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.
 
Top