0

在 sql 表中,我选择重复 ID,其计数 > 1。然后我只需要更新选择重复 id 行的第一行。如何仅更新第一行值。提前致谢。

4

1 回答 1

0

Assuming you have something like this:

SELECT ID
FROM ProductView
GROUP BY ID
HAVING COUNT(*) > 1

You will need to create a loop around the query and then select a result using TOP 1 and matching the ID. You can create the loop using a cursor.

于 2013-08-12T14:20:15.270 回答