Employee table
empName | deptName |
Raju Das | Engg |
Shashi | Engg |
Prashant | Engg |
Raju Das | Engg |
Prashant | Engg |
Raju Das | Engg |
Shashi | Engg |
Ravi | Mamagement |
with cte(empName, deptName,rowid) as
(
select *, ROW_NUMBER() over (PARTITION by empname,deptname order by empname,deptname) as rowid
from employee1
)
delete from cte where rowid > 1
Note: cte = Common Table Expressions
Using cte function, update and select operation can only be done
No comments:
Post a Comment