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 an index. What are the types?
How can sql injection be stopped? : sql server security
Explain full-text query in sql server?
What is a scheduled job or what is a scheduled task?
What is cube dimension? : sql server analysis services, ssas
What are the 2 types of classifications of constraints in the sql server?
What is xml datatype?
What is replication with database mirroring? : sql server database administration
What is default constraint in ms sql server?
Can sql server 2016 run on windows 7?
What are the different authentication modes in sql server?
How to select some specific columns from a table in a query in ms sql server?
What is read committed?
As per your opinion what are the five top responsibilities of a dba? : sql server database administration
What is sql server profiler?