SELECT DISTINCT (A.salary) FROM EMPLOYEE A WHERE &N= (SELECT COUNT (DISTINCT (B.salary) FROM EMPLOYEE B WHERE A.salary<=B.sal ary);
Enter value for n :3...
User Profile
Collapse
-
[QUOTE=ranjitkum ar]Hi,
Do anyone know a query for the following senario,
I have a table in which i have multiple rows with the same entry. I want to keep only one copy of such rows. How to write a query to delete all the duplicate rows and have only one entry for such with a single query???
For example
create table Employee
{
empno char(5),
name varchar2(20),
...Leave a comment:
-
[code=oracle]
delete from employee where rowid not in (select max(rowid) from employee group by empno);
[/code]
or
[code=oracle]
delete from Employee emp where rowid <(select min(rowid) from Employee emp1 where emp.empno=emp12 .empno);
[/code]...Leave a comment:
No activity results to display
Show More
Leave a comment: