write sub query for eliminating duplicate rows using
analytical function?
Answers were Sorted based on User's Feedback
Answer / korimantu
delete from table name where rowid not in(select max(rowid)
from group by last_name);
or
delete from table name where rowid>(select min(rowid) from
where a.last_name=b.last_name);
| Is This Answer Correct ? | 4 Yes | 2 No |
Answer / vyshak
delete from table where rowid not in (select max(rowid) from
table group by all column names);
or
delete (dense_rank() over(partition by all column names))dn
from table where dn>2;
| Is This Answer Correct ? | 4 Yes | 3 No |
Can we create foreign key without primary key?
What is rank dense_rank and partition in sql?
What is posting?
Can we use distinct and group by together?
give the syntax of grant and revoke commands? : Sql dba
What is the difference between a primary key and a clustered index?
How do I pipe the output of one isql to another?
what are null values? : Sql dba
How do I turn a list into a table?
How can I see all tables in sql?
What is meant by <> in sql?
Can there be more than one function with a similar name in a pl/sql block?
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)