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 the difference between python and sql?

717


How many types of index are there?

726


Explain the difference between drop and truncate commands in sql?

745


what does the t-sql command ident_incr does? : Transact sql

811


What are the different sql languages?

754


Write the order of precedence for validation of a column in a table? I. Done using database triggers. Ii. Done using integarity constraints

852


What is the use of triggers?

743


what is an execution plan? When would you use it? How would you view the execution plan? : Sql dba

734


Can a composite key be null?

722


How do you explain an index?

993


what is cursor. write example of it. What are the attributes of cursor.

983


Which software is used for pl sql programming?

691


How do we accept inputs from user during runtime?

741


what is the difference between sql and t-sql? : Transact sql

818


What is dba in sql? : SQL DBA

759