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
Can we connect to postgresql using sql developer?
What is an intersect?
How to move files from one directory to another in pl sql?
What is auto increment?
Explain the the delete statements in sql?
What is sql constant?
What is cursor and its types?
Why commit is not used in triggers?
What are primary key and foreign key and how they work?
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
How can I delete duplicate rows?
Sql technical questions
What is sql data?
Is inner join faster than left join?
how can we know the number of days between two given dates using mysql? : Sql dba