Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Replace Sql LEFT JOIN Null Result with something

Author  Topic 

Bortiquai
Starting Member

4 Posts

Posted - 2007-12-30 : 09:30:48
I am using a SQL Left Join statement. How can I replace results whos values are NULL with something static, like 'Unknown', or even blank.

Thanks

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2007-12-30 : 09:34:44
Use ISNULL() or COALESCE() function.

IsNull(col1, 'Unknown')


Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

Bortiquai
Starting Member

4 Posts

Posted - 2007-12-30 : 10:03:56
Perfect - Thank you. Is there a way to mark as answer or give credit? I'm new to this forum.
Thanks.
Go to Top of Page

georgev
Posting Yak Master

122 Posts

Posted - 2007-12-30 : 12:08:17
quote:
Originally posted by harsh_athalye

Use ISNULL() or COALESCE() function.

IsNull(col1, 'Unknown')


Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"


Use Coalesce() ;)


George
<3Engaged!
Go to Top of Page
   

- Advertisement -