User Profile

Collapse

Profile Sidebar

Collapse
ck1004
ck1004
Last Activity: Nov 15 '06, 05:45 AM
Joined: Nov 14 '06
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • 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...
    See more | Go to post

    Leave a comment:


  • ck1004
    replied to Query to eliminate dulicate rows
    [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),
    ...
    See more | Go to post

    Leave a comment:


  • ck1004
    replied to Query to eliminate dulicate rows
    [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]...
    See more | Go to post
    Last edited by amitpatel66; Nov 15 '07, 08:31 AM. Reason: code tags again

    Leave a comment:

No activity results to display
Show More
Working...