Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Duplicate Fields - A CHALLENGE !!

Re: Duplicate Fields - A CHALLENGE !!

From: Bob Fazio <bob_fazio_at_hotmail.com.no.spam>
Date: Mon, 13 Sep 1999 23:44:17 GMT
Message-ID: <l%fD3.941$FB4.56899@news.rdc1.pa.home.com>


I guess the obvious question is why not just put a unique constraint on description,area_key when the constraint is enabled put the exceptions into an exception table.

Rather than getting your item number, you will get the rowid of the violating rows.

Gareth Elliott <gelliott_at_nisoft.co.uk> wrote in message news:049F56710FD6D211B08D006097A4426B10F112_at_ORION...
> Hi
>
> Im trying to find out if any duplicate descriptions exist within one
> area_key.The following sql does this.
>
> select description,area_key
> from items
> group by description,area_key
> having count(*) > 1
>
> I also need to return the item_no from items for the records returned from
> the above sql. This field is always unique and therefore the count(*) > 1
> will return nothing if item_no is just added to this statement.
>
> Many thanks in advance
>
> Gareth
>
>
>
Received on Mon Sep 13 1999 - 18:44:17 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US