one of the column in my table contains the data like
SAL
----
1000
1000
2000
3000
3000

So my requirement is i want output like
SAL
---
1000
2000
3000

it mean i want to delete duplicate rows in the table
permanently and i want output in the above formatow should u
write query?

Answer Posted / guest

SQL> DELETE FROM <TABLE_NAME>
WHERE (ROWID,SAL) NOT IN
(SELECT MIN(ROWID),SAL FROM <TABLE_NAME>
GROUP BY SAL);

Is This Answer Correct ?    13 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is recursive stored procedure?

600


What is sql*loader?

572


What are the types of records?

527


what are local and global variables and their differences? : Sql dba

537


What are the two types of exceptions in pl/sql?

544






Can procedure in package be overloaded?

608


What is linq to sql?

552


Explain the working of primary key?

606


Is sql between inclusive?

588


Which is faster subquery or join?

658


Does pl sql work in mysql?

534


Where is sql database stored?

519


How would you reference column values before and after you have inserted and deleted triggers?

620


How many types of cursors are available in pl/sql?

586


What is the difference between database trigger and stored procedure?

555