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 2012 Forums
 SQL Server Administration (2012)
 Add a value IF ISNULL

Author  Topic 

nino59
Starting Member

3 Posts

Posted - 2013-05-14 : 11:28:58
Hi,

I need again your help. Something very easy for you I guess:

I need to add a value in the column of a table when the value is null.
So let's say I have table_ads with the columns:
id country
1 GB
2 GB
3
4
5 GB

I need an SQL query to add the value 'GB' when country IS NULL

Someone can help me?

Regards

James K
Master Smack Fu Yak Hacker

3873 Posts

Posted - 2013-05-14 : 12:13:39
[code]UPDATE table_ads SET country = 'GB' WHERE country IS NULL;[/code]
Go to Top of Page
   

- Advertisement -