xm1984 发表于 2009-10-13 19:25

update如何只更新记录号最大的一条记录

我这样写
update tbl_aset data= "hello"
where seq = (selectmax(seq) from tbl_a);

这样存在360的错误,不能使用临时表,如何通过调整sql实现?

wenlq 发表于 2009-10-23 09:38

-360    Cannot modify table or view used in subquery.

The UPDATE, INSERT, or DELETE statement uses data taken from the same table
in a subquery. This action is not allowed because of the danger of getting
into an endless loop. Select the input data into a temporary table first,
and then refer to the temporary table in the UPDATE or INSERT statement.

superzg 发表于 2009-10-23 10:54

先找到SEQ最大的记录,在修改不行吗?
页: [1]
查看完整版本: update如何只更新记录号最大的一条记录