Friday, August 12, 2011

how to replace null values with special words or symbols in sql server 2005

select userid,firstname,isnull(lastname,'_'),isnull(address,'-'),phonenumber,city from tblemployee

OutPut

firstname     lastname         address       phonenumber         city

ram           godishala saptapadi     546778888         hyderabad
mougf    vaddadi          45               69876543            hyderabad
gtdfs             _                  _             87646434         vizag
prasad     d                  _             45656565         hyd

No comments:

Post a Comment