在 sql 表中,我选择重复 ID,其计数 > 1。然后我只需要更新选择重复 id 行的第一行。如何仅更新第一行值。提前致谢。
问问题
1124 次
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.