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: Help with SQL constraint

Re: Help with SQL constraint

From: dean <deanbrown3d_at_yahoo.com>
Date: 14 Feb 2007 23:43:23 -0800
Message-ID: <1171525403.525419.59930@a34g2000cwb.googlegroups.com>


On Feb 15, 1:41 am, Arto Viitanen <arto.viita..._at_csc.fi> wrote:
> dean wrote:
> > Hello all,
>
> > A table T has 2 fields, one (L) holding letters 'Y' and 'N', and one
> > (X) holding numbers. Is there a (non trigger) constraint such that for
> > L='N' (and only this letter) the numbers must be unique? Records
> > where L='Y' do not have to be unique.
>
> > (I need to join another table to the L='N' group of records, and the
> > join must be key-preserved).
>
> > Cheers,
>
> > Dean
>
> Why not divide the table to two tables, one containing to constraint
> (with UNIQUE) and the other not. Then make a view using UNION for the
> original table.
>
> --
> Arto Viitanen, CSC Ltd,
> Espoo, Finland

I considered that way, but I can't change it now, its not a new table, its been ingrained into the heart of out system for many years. Received on Thu Feb 15 2007 - 01:43:23 CST

Original text of this message

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