sql server - Instead of NULL how do I show `0` in result with SELECT statement sql? -


i have 1 stored procedure giving me output (i stored in #temp table) , output i'm passing scalar function.

instead of null how show 0 in result select statement sql?

for example stored proc having select statement follwing :

select ename , eid , eprice , ecountry etable ecountry = 'india' 

which giving me output like

ename    eid    eprice    ecountry ana      12     452       india bin      33     null      india cas      11     null      india 

now instead of showing null how can show price 0 ?

what should mention in select statement make null 0 ?

use coalesce():

select  coalesce(eprice, 0) eprice 

in sql server only, can save 2 characters isnull():

select  isnull(eprice, 0) eprice 

Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -