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
Can sql servers linked to other servers?
How to get nth highest salary from employee table.
What is the purpose of sql profiler in sql server?
What is transaction server explicit transaction?
Explain the use of containers in ssis?
Please explain go command in sql server?
Do you know what is a with(nolock)?
What is difference between Datepart() and Datename() in SqlServer?
What is abstracting periodical?
How to rebuild indexes with alter index ... Rebuild?
What is meant by dirty read?
if no size is defined while creating the database, what size will the database have? : Sql server administration
Please explain that what are the basic functions for master, msdb, model, tempdb and resource databases? : SQL Server Architecture
What are the difference between “where” and “having” clause in sql server?
What is a document index?