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 / sarthak mohanty

DELETE
from <table_name> a
where a.rowid > ANY(select b.rowid
from <table_name> b
where a.salary=b.salary);

Is This Answer Correct ?    6 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Does sql*plus have a pl/sql engine?

569


List different type of expressions with the example.

546


What is rank dense_rank and partition in sql?

537


i have 2 table table one 4 columns respective values a1 7,a2 6,a3 8 ,a4 12 & table two 4 colums respective values a1 7,a2 6,a3 8,a4 15.if table one & table two 3 colums same then 4th column values 1)Qes diff >5 then print 5 * diff value 2)Que diff <5 print 5

3198


Can we have two clustered index on a table?

562






Is clustered index a primary key?

528


How can one get sql*loader to commit only at the end of the load file? : aql loader

565


What is the difference between having clause and where clause?

567


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

586


What are the built in functions of sql?

561


What is dynamic query?

539


what is a join? : Sql dba

561


How can you tell the difference between an index and a view?

490


What is right join in sql?

551


Is crud a cuss word?

546