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 |
|
Rheinhardt
Yak Posting Veteran
66 Posts |
Posted - 2009-07-28 : 01:58:04
|
| Hi,I want to update a table (customer_master) column...basically I want to set the [stop code] column= the same [stop code] column in the table cust_stopcodes where the fields are blank in [stop code](customer_master)see below:select c.*,s.[stop code] from customer_master cjoin cust_stopcodes son c.[customer no]=s.[customer no]where c.[stop code]='' or c.[stop code]=' ' or c.[stop code]is nullupdate customer_master cset c.[customer no]=s.[customer no] where c.[stop code]='' or c.[stop code]=' ' or c.[stop code]is nullPlease assist?Thanks |
|
|
Rheinhardt
Yak Posting Veteran
66 Posts |
Posted - 2009-07-28 : 02:02:46
|
| Thanks! |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2009-07-28 : 02:03:10
|
[code]update customer_master cset c.[customer no]=s.[customer no] c.[stop code] = s.[stop code]from customer_master c inner join cust_stopcodes s on c.[customer no] = s.[customer no]where c.[stop code]='' or c.[stop code]=' ' or c.[stop code]is null[/code] KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
|
|
|