Write a query to delete duplicate records in SQL SERVER
Answer Posted / saurabh dixit
DECLARE @people TABLE
(
name VARCHAR(32),
age INT
)
insert into @people
select Name,age From People group by Name,Age having COUNT(name)>1
delete People from People pe
join @people p on pe.name=p.name and pe.age=p.age
| Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
It is important form e to get the information from log files of applications executed by the task scheduler? Does sql studio save these log files? : sql server management studio
Working with TLogs
How to replace the Query Result 'Null Value' with a text ?
How to get @@error and @@rowcount at the same time?
Can we write trigger for view?
what are the disadvantages of cursors? : Sql server database administration
What are indexes in ms sql server?
How to find out the list schema name and table name for the database?
How to loop through result set objects using mssql_fetch_array()?
How do you rename a table in sql server?
What is 2nf in normalization?
How to transfer data from a cursor to variables with a "fetch" statement?
1.what are diff types of joins , and explain diff between cross join and full outer join 2.diff types of views 3. Diff types of index 4. What is diff b/w stores procedure and function procedure 5.diff between double and int in SQL 6.diff between char and varchar in SQL. 7.Oracle or SQL whice you will preferred and why.
Where actually sql azure database is hosted?
Tell me what do you understand by a view? What does the with check option clause for a view do?