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 |
Agwright
Starting Member
2 Posts |
Posted - 2014-09-30 : 13:05:00
|
Www.tony"'mnn…,Hi How can I do the following ...I have a table called postcode and there are a number of record that don't have a area assigned so I need to update the the "blank" one to equal the values in the corresponding record I can't delete records I.e.2222 and 2223 as this would cause other issues Table PostcodeRow ID | Postcode | Area2221 AB123CD LONDON2222 AB123CD <blank>2223 BB234EF <blank>2224 BB234EF GLASGOW This table hold 250k recordsend result needed is Row ID | Postcode | Area2221 AB123CD LONDON2222 AB123CD LONDON2223 BB234EF GLASGOW2224 BB234EF GLASGOW |
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2014-09-30 : 13:23:22
|
UPDATE t2SET Area = t1.AreaFROM t2JOIN t1 ON t2.Postcode = t1.PostcodeWHERE t2 = ''Tara KizerSQL Server MVP since 2007http://weblogs.sqlteam.com/tarad/ |
|
|
Agwright
Starting Member
2 Posts |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
|
|