Re: query needed

From: Mathias Magnusson <mathias.magnusson_at_gmail.com>
Date: Mon, 18 May 2009 08:14:13 +0200
Message-ID: <8580d4110905172314rb9af46bnbd96163e928cec92_at_mail.gmail.com>



delete from emp a where not a.rowid = (select min(b.rowid) from emp b where a.eno = b.eno)
Just quick query with no testing (so the testing is your job). Also, depending on volume, you may need a different approach, but if it is volume like the normal emp table, then performance will not be your main concern.

Mathias

On Mon, May 18, 2009 at 7:58 AM, Mohammed Mehraj hussain < mhdmehraj_at_gmail.com> wrote:

> Hi Everybody,
>
> I have a table with this columns
>
> For Eg:
>
> Table Name: emp
>
> eno
> ename
> salary
> date
> -----------------------------
>
> In eno i dont have primary key as well as unique index ,
> so i got duplicate records in my table ,
>
> so i need to check the table with the eno column , If any eno is
> repeted then i need to delete one of those eno.
>
> so , Plz provide a query to check the above case.
>
> Rehgards,
> Mohammed Mehraj Hussain
> --
> http://www.freelists.org/webpage/oracle-l
>
>
>

--
http://www.freelists.org/webpage/oracle-l
Received on Mon May 18 2009 - 01:14:13 CDT

Original text of this message