There is a big table with "n" of rows and 40 + columns .It
doesn't have primary key.How do you select the primary key.
In other words how do you get the duplicate records.
Answers were Sorted based on User's Feedback
Answer / nithin
Hi
I could possibly think of only one solution without using
group by clause.
create table emp_bkp as select distinct * from employee
drop table employee
rename emp_bkp to employee
Let me know if there is any other possible answer
Is This Answer Correct ? | 3 Yes | 1 No |
Suppose Table name is Dup_Del with id as a column(consists
10,20,30,10,10,30,20)then
select * from Dup_Del
where rowid not in(select * from
(select min(rowid) from Dup_Del
group by id
);
the above query will give you the duplicate records. if you
want unique records then
select * from Dup_Del
where rowid in(select * from
(select min(rowid) from Dup_Del
group by id
);
Is This Answer Correct ? | 0 Yes | 0 No |
I have one table :EID,Depid,ename,sal I want to have max(sal) in each department.
5 Answers Microsoft, Oracle, TCS,
what is the syntax of DROP command?
What is a Shared SQL pool ?
Table E: Name dept month sal 1 A JAN 800 2 B APR 1000 3 A JAN 300 4 A JAN 600 5 C JUN 400 1) SELECT HIGHEST SAL PAID DEPT IN JAN MONTH? 2) WRITE QUERY GET MAX SAL DEPT NO?
Can a View based on another View ?
What is the sid in oracle?
what is IDE,DMV in sql server?
What is Data Dictionary Cache in Oracle?
How to run the anonymous block again?
18. Display the clientno and total value for all orders placed by that client. Output the result in the following format: Client <clientno> has placed orders to the value of <total value>
How to use group functions in the select clause using oracle?
How to update a table row with a record?