
Hi,
Refer the following query's...
To Delete the duplicate rows...
If you check multiple columns means add those columns in
Partiton by Col1,Col2,Col3
with delqry
as
(Select row_number() over(partition by ID,Name order by ID) as sNo,ID from TableName)
Delete from delqry where sNo > 1
To find the duplicate records....
If you check multiple columns means add that in group by
Select ID,Name from TableName group by ID,Name having count(*) > 1
Diff b/w
Delete and Truncate
using
Delete means we can rollback the data.
syntax: delete from TableName
using
Truncate means cannot be rollback the data.
syntax: truncate table TableName
If any doubts ask me.
Cheers :)
Thanks,
T.Saravanan
Anweshabhowmick, if this helps please login to Mark As Answer. | Alert Moderator