sql语句问题请人指正

来源:百度知道 编辑:UC知道 时间:2024/05/02 16:58:18
update currentAuction set id=(select min(id) from tmpinfo where num=(select top 1 pid from oldinfo))

谁帮我修改一下
select min(id) as id from tmpinfo where num=(select top 1 pid from oldinfo)
可以得到唯一值
我晕,怎么跑到外语分类里了。

我希望能更新数据库中字段的值
更新currentAuction表中的id,id的值等于tmpinfo表中num等于oldinfo表中第一条记录的pid值的最小id

update currentAuction set id=(select min(num) from tmpinfo where num=(select top 1 pid from oldinfo)) ,

我只看到这么多错误, 别的就不知道了.你的min(id)是在表tmpinfo中查的,而id是在表currentAuction中,这应该是个错误吧?