myql update from 语句

(6)UPDATE 语句与 SELECT 语句中的 TOP 子句一起使用
对来自表 authors 的前十个作者的 state 列进行更新

UPDATE authors
SET state = 'ZZ' FROM (SELECT TOP 10 * FROM authors ORDER BY au_lname) AS t1 WHERE authors.au_id = t1.au_id

猜你喜欢

转载自www.cnblogs.com/hehexu/p/9031282.html