Answer Posted / anand
TABLENAME: testanand
DATA:
id vanme emailid age
-- ------ ---------- ------
1 Anand anand.kv@abc.com 29
2 Anand anand.kv@abc.com 28
3 Rajesh rajesh@abc.com 30
4 Rajesh rajesh@abc.com 31
5 Vinit vinit@abc.com 21
6 Vinit vinit@abc.com 25
DELETE FROM testanand WHERE id Not IN
(SELECT min(id) FROM testanand GROUP BY vname)
RESULTS:
id vanme emailid age
-- ------ ---------- ------
1 Anand anand.kv@abc.com 29
3 Rajesh rajesh@abc.com 30
5 Vinit vinit@abc.com 21
| Is This Answer Correct ? | 8 Yes | 1 No |
Post New Answer View All Answers
What are the steps you will take to improve the performance of a poor performing query?
what is a transaction and what are acid properties? : Sql server database administration
What is the New in SQL server 2008?
What is after dml trigger?
Recommend an approach to ensuring that all changes in the remote databases synchronize with the SQL Azure database?
How to modify the underlying query of an existing view?
What is self join in sql server joins?
What do you understand by physical_only option in dbcc checkdb?
How do you troubleshoot errors in a SQL Server Agent Job?
What is the maximum number of index per table?
What is 'Join' and explain its various types.
How to view existing indexes on an given table using sys.indexes?
How to rename an existing column with the "sp_rename" stored procedure in ms sql server?
How can I check if a view exists in a sql server database?
What do you mean by authentication modes in sql server?