select statement

  • Thread starter Thread starter xarrisx
  • Start date Start date
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
 
Use the function IsNull in your select statement:

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

S. L.
 
Back
Top