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 / amit

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

Is This Answer Correct ?    9 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is a composite key ? : Sql dba

798


when is the use of update_statistics command? : Sql dba

685


What is the difference between rollback and rollback to statements?

806


What is the use of sqldataadapter?

704


what are the differences between char and nchar? : Sql dba

797






Why do we need cursors in pl sql?

721


How can get second highest salary in sql?

690


What information is needed to connect sql*plus an oracle server?

767


how to run 'mysql' commands from a batch file? : Sql dba

777


Are ddl triggers fired for ddl statements within a pl/sql code executed using the dbms.sql package?

835


What is the basic form of sql query?

679


What does the base_object_type column shows in the user.triggers data dictionary view?

760


What are the syntax and use of the coalesce function?

773


What is primary key and unique key?

762


How to prepare for oracle pl sql certification?

780