update b set 商家编号=a.商家编号 from a,b where b.卡号 between 号段起 and 号段终
解决方案 »
- sql server 2005安装后只有配置工具怎么解决
- 求MS-SQL2000 32位升级到MS-SQL2005 64位版的方案
- sql server 2005连接数据库服务器问题
- 为什么记录ID自动标识的值会是一个已经使用过的值?
- 如何开启后xp_cmdshell结束windows进程?
- ★多表合并★把一对多的关联表中的数据合并到一张中以后用字符隔开的问题
- 附加数据库问题,急,在线等
- 几个简单的某公司的招聘试题
- 如何设置一个用户或创建一个角色,限定访问指定的表或创建自己的表,其他人创建的表和库不显示??
- 一个sqlserver存储过程转oracle的语句
- 如何选出今天的记录,昨天的记录,这周的记录?
- 用select * into t from table抱错
insert Am select 'cd0001' ,1 ,10
union all select 'cd0002' ,11, 20
union all select 'cd0003' ,21, 30create table Bm(卡号 int, 商家编号 varchar(10))
insert bm select 1, null
union all select 2 ,null
union all select 3, null
union all select 4, null
union all select 5, null
union all select 6, null
union all select 7, null
union all select 8, null
union all select 9, null
union all select 10, null
union all select 11, null
union all select 12, null
union all select 13, null
union all select 14, null
update bm set 商家编号=am.商家编号 from am,bm where bm.卡号 between 号段起 and 号段终select * from bm
----------- ----------
1 cd0001
2 cd0001
3 cd0001
4 cd0001
5 cd0001
6 cd0001
7 cd0001
8 cd0001
9 cd0001
10 cd0001
11 cd0002
12 cd0002
13 cd0002
14 cd0002(所影响的行数为 14 行)