lingdian
路人甲
路人甲
  • 注册日期2005-06-08
  • 发帖数12
  • QQ
  • 铜币142枚
  • 威望0点
  • 贡献值0点
  • 银元0个
阅读:1342回复:1

[求助]在表中自动添加ID的值的语句要怎么写update 表 set id = ??

楼主#
更多 发布于:2005-06-15 10:39
在表中自动添加ID的值的语句要怎么写update 表  set  id = ??
喜欢0 评分0
qizhf
路人甲
路人甲
  • 注册日期2004-06-07
  • 发帖数57
  • QQ
  • 铜币277枚
  • 威望0点
  • 贡献值0点
  • 银元0个
1楼#
发布于:2005-06-21 19:29
<P>dim myid as integer</P>
<P>dim Objrowid as integer</P>
<P>myid=1</P>
<P>select * from TableName</P>
<P>  into MyTable</P>
<P>fetch first from MyTable</P>
<P>while not eot(MyTable)</P>
<P>  ObjRowid=MyTable.Rowid</P>
<P>  update Mytable </P>
<P>    set ID=myid</P>
<P>    where Rowid=Objrowid</P>
<P>  myId=myid+1</P>
<P>  fetch next from MyTable</P>
<P>wend</P>
举报 回复(0) 喜欢(0)     评分
游客

返回顶部