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

Can we connect to postgresql using sql developer?

484


What is an intersect?

650


How to move files from one directory to another in pl sql?

642


What is auto increment?

580


Explain the the delete statements in sql?

577






What is sql constant?

507


What is cursor and its types?

556


Why commit is not used in triggers?

576


What are primary key and foreign key and how they work?

547


Table 1: col1 Timestamp ---------------- 01-mar-2012 11:12:46 Table 2: col2 Timestamp -------------------- 01-mar-2012 11:12:10 01-mar-2012 11:11:23 Write a query to display a row with table2 col2 value less than tabl1 col1 value. Maximum timestamp value previous to table1 col1 value. Display a result as: Col1 col2 ----- ----- 01-mar-2012 11:12:46 01-mar-2012 11:12:10

1724


How can I delete duplicate rows?

562


Sql technical questions

775


What is sql data?

548


Is inner join faster than left join?

631


how can we know the number of days between two given dates using mysql? : Sql dba

543