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.
Author |
Topic |
dhayasridhar
Starting Member
1 Post |
Posted - 2013-05-14 : 07:58:40
|
i have two tables in my database table1 & table2.Table1 have (id,country_name,country_short_name,country_code)Table2 have (country_name,country_short_name).So Table1 have contain lots of data and some country names are repeated in that table.But Table1 country_short_name rows are null. So i need to update that country_short_name rows. |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-05-14 : 08:04:27
|
[code]UPDATE t1SET t1.country_short_name = t2.country_short_nameFROM table1 t1inner join table2 t2on t2.country_name = t1.country_namewhere t1.country_short_name is null[/code]------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs |
|
|
|
|
|