找关系差匹配字,然后将结果先select出来看是否正确,
正确后,再将select语句改为update语句。
正确后,再将select语句改为update语句。
解决方案 »
- 很简单
- 请问:XP下安装SQLSERVER个人版时运行AUTORUN.exe直接不反应,请问如何解决?我以前装过企业版的,现已卸载了,注册表也删除了,安装文件夹也删除了。请问为什么?
- 设置基于声明的验证方式后,Sharepoint还原后权限丢失,请高手释疑
- 哪位高手能帮忙写个储存过程
- 怎样在SQL server 2000中实现表之间的联系,初学SQL server 2000,好多不懂!急
- 数据库数据文件异常增长的问题,急啊,在线等想.
- 很头痛的事
- 请各位高手帮我修改一下这个存储过程,小弟不甚感激。
- 数据报送问题:
- sql的'问题
- 在存储过程中select得到一个视图后,如何继续在存储过程中对得到的记录做处理
- SQLSERVER 2000 LDF文件异常变大,找不到原因何在
insert into t1 select '广州市海珠区皇后大道中'
insert into t1 select '广州市棠下区先烈路'create table t2(address varchar(100))
insert into t2 select '皇后大道中32号205房'
insert into t2 select '先烈中路314号'set rowcount 100
select identity(int,1,1) as id into #t from sysobjects
set rowcount 0select
id,
b.address+stuff(c.address,1,a.id,'')
from
#t a,
t1 b,
t2 c
where
a.id<=len(b.address) and a.id<=len(c.address)
and
right(b.address,a.id)=left(c.address,a.id)drop table t1,t2,#t
insert into t1 select '广州市海珠区皇后大道中'
insert into t1 select '广州市棠下区先烈路'create table t2(address varchar(100))
insert into t2 select '皇后大道中32号205房'
insert into t2 select '先烈中路314号'set rowcount 100
select identity(int,1,1) as id into #t from sysobjects
set rowcount 0update d
set
address = e.newaddress
from
t2 d,
(select
c.address,
b.address+stuff(c.address,1,a.id,'') as newaddress
from
#t a,
t1 b,
t2 c
where
a.id<=len(b.address) and a.id<=len(c.address)
and
right(b.address,a.id)=left(c.address,a.id)) e
where
d.address = e.addressselect * from t2drop table t1,t2,#t