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 / dinesh kumar

delete from table_name alias1
where rownum < ( select max(rownum) from table_name alias2
where alias1.col1 = alias.col2 );

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what are string data types? : Sql dba

517


what are the system privileges that are required by a schema owner (user) to create a trigger on a table?

626


What is the sql*loader? : aql loader

591


What will you get by the cursor attribute sql%notfound?

595


Is pl sql useful?

543






Define select, insert, create, delete, update, drop keywords

600


how to create a new view in mysql? : Sql dba

501


What is sqlservr exe?

482


What are the three pl sql block types?

573


How do I create an index in word?

542


What are the commands used in sql?

527


Differentiate between % rowtype and type record.

735


What is difference between rank () row_number () and dense_rank () in sql?

582


Can we create foreign key without primary key?

538


What schema means?

529