喜欢分的朋友进来看看,半卖半送!

antiking 2003-01-31 11:14:58
数据库表象这样
tabel A
a b c
ww null rr
vv null yy
cc null bb
dd null qq
ee null jj
.
.
.
我要使它变成这样
tabel A
a b c
ww 1 rr
vv 2 yy
cc 3 bb
dd 4 qq
ee 5 jj
.
.
.
请问语句怎么写?
...全文
45 6 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
happydreamer 2003-01-31
  • 打赏
  • 举报
回复
ALTER TABLE table ADD tmp int identity(1,1) not null

alter table cloth drop column b

EXEC sp_rename 'table.[tmp]', 'd', 'COLUMN'
pengdali 2003-01-31
  • 打赏
  • 举报
回复
ALTER TABLE A ADD b1 int identity(1,1) not null
update a set b=b1
alter table A drop column b1
pengdali 2003-01-31
  • 打赏
  • 举报
回复
ALTER TABLE A ADD b1 int identity(1,1) not null
update tablename set b=b1
alter table A drop column b1

antiking 2003-01-31
  • 打赏
  • 举报
回复
怎么没人回答我的问题,我的意思是在
tabel A
a b c
ww null rr
vv null yy
cc null bb
dd null qq
ee null jj
.
.
.
的基础上使b字段递增。
antiking 2003-01-31
  • 打赏
  • 举报
回复
呵呵,送呀,进者有分!我的意思是我要使b字段自动递增!
zhangchaokun 2003-01-31
  • 打赏
  • 举报
回复
The First,
可以只要分吗。
我不明的你的意思
谢谢

34,838

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server相关内容讨论专区
社区管理员
  • 基础类社区
  • 二月十六
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧