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 / bibhudatta panda

DELETE FROM TABLENAME
WHERE ROWID NOT IN(
SELECT MAX(ROWID)
FROM TABLENAME
GROUP BY Sal
)

Is This Answer Correct ?    4 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is dbo in sql?

533


What is cartesian join in sql?

557


What is difference between stored function and application function?

594


What is set serveroutput on in pl sql?

567


What is sql character function?

541






What is view? Can we update view

867


How many clustered indexes can be created on a table?

588


What is column?

548


how many sql ddl commands are supported by 'mysql'? : Sql dba

524


What has stored procedures in sql?

595


what is offset-fetch filter in tsql? : Transact sql

533


Can dml statements be used in pl/sql?

577


When a dml statement is executed, in which cursor attributes, the outcome of the statement is saved?

634


How to check if a column is nullable before setting to nullable?

581


what is recursive stored procedure? : Sql dba

527