我试过了,
delete from Student where FirstName in
(
select FirstName from
(
select FirstName,
row_number() over(partition by FirstName order by FirstName) as rn
from Student
) Student
WHERE rn > 1
);
但它删除了两个重复的记录。 请更正我的疑问。 提前谢谢。
答案 0 :(得分:2)
您可以使用CTE
WITH MyCTE
AS
(
SELECT [FirstName], ROW_NUMBER() OVER(PARTITION BY FirstName ORDER BY FirstName) RN
FROM Student
)
DELETE FROM MyCTE WHERE RN > 1;
SELECT * FROM Students;
答案 1 :(得分:0)
您正在根据FirstName删除,因此它会删除您桌面上的所有记录,请尝试这样做。
i=143
baseurl = 'https://example.com/listproduct/index/21/' + str(i)
while (i>0):
i-=1
print(baseurl)