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 is the purpose of grouping data in a report?
What is difference between foreign key and unique key?
What is the new security features added in sql server 2014? : sql server security
What is rs.exe utility?
how would you store your query in an SSRS report or a Database server?
How to list all user names in a database?
what are the different stages of Report Processing?
What authentication modes does sql server support?
what are triggers? : Sql server database administration
Explain about integration services of Microsoft SQL server?
Relational calculus is what type of language?
What is purpose of normalization?
How to use subqueries in the from clause in ms sql server?
How to delete multiple rows with one delete statement in ms sql server?
How do I start sql server 2017?