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 |
What is native sql query?
Can we join 3 tables in sql?
What are tables and fields in the database?
What is an escape character in sql?
What is difference between hql and native sql?
What is the difference between local and global temporary table?
ERROR:Insert or update on table"accnt" violates foreign key constraints "acct_to_curr_symbol" DETAILS:KEY(accnt_curr_id)(-2)is not present in the table "curr_symbol" ......solve The Problem..
What are the different types of a subquery?
there is A table and B table in A table there 5 rows and in b table there are 2 rows i am firing query select * from a,b what will be the output?
Can you upgrade sql express to full sql?
What is a transaction?
how to check the 3rd max salary from an employee table?
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)