;with abc(pid,pname,PPID)
as
(
SELECT ProductID, ProductName,ROW_NUMBER() OVER(partition BY
ProductName ORDER BY ProductName) AS PPID
FROM Products
)
--DELETE FROM ABC WHERE PID=2
SELECT * FROM ABC
as
(
SELECT ProductID, ProductName,ROW_NUMBER() OVER(partition BY
ProductName ORDER BY ProductName) AS PPID
FROM Products
)
--DELETE FROM ABC WHERE PID=2
SELECT * FROM ABC
No comments:
Post a Comment