Write a query to delete duplicate records in SQL SERVER
Answer Posted / bala_it243
using the following query u can delete the duplicate records.
but it is available only on SQL Server 2005.
with mytable as
(
select *, ROW_NUMBER() OVER(partition by id,myname order by
id desc) as RowNumber from test
)
delete from mytable where rownumber>1
"Have a Great Day"
Bala
Is This Answer Correct ? | 16 Yes | 5 No |
Post New Answer View All Answers
Insert syudents details in table.Current system date &time insert into joining time.How do insert?( in sysdate only return current system date how do add time?)
What is indexing explain it with an example?
Explain partitioned view?
explain different levels of normalization? : Sql server database administration
You schedule a job to run every minute what will happen if the first job runs more than 1 min? Will the second instance of the job start?
How to see the event list of an existing trigger using sys.trigger_events?
What is the difference between char and varchar2 datatype in sql?
How many databases Microsoft SQL server provides?
Is sql server difficult to learn?
what stored procedure can you use to display the current processes? : Sql server administration
How to create a Master database in SQL server ?
What are sql server functions?
Can we update data in a view?
How to list all field names in the result set using mssql_field_name()?
How column data types are determined in a view?