Oracle Problem from a beginner

From: (wrong string) Áéºa¹F <jliuws_at_hkstar.com>
Date: 1997/11/16
Message-ID: <64mdg6$2673_at_lyra.hkstar.com>#1/1


[Quoted] Hello every body!

[Quoted]   I am a beginner of Oracle in Hong Kong, I have a table which structures are listed as follows:

   ref_no varchar(8)
   date_from date
   date_to date

  I need to setup a constraint to this table to ensure that there is no [Quoted] overlapping date range in all rows so I want to setup following constraint [Quoted] just example ) :

   alter table booking

      add constraint CHECK_DOBULE_BOOKING check ( not (

( date_to < ( select date_from from booking ) ) and
( date_from > ( select date_to from booking ) ) ) )

  I was prompted that Oracle doesn't support sub-query in this case. how can [Quoted] I do it by table constraint? and how can I distinguish the field between the [Quoted] newly added one and the one already inside the table when setup a constraint?

Chung Wing Tat
wtchung_at_writeme.com

16-Nov-1997 Received on Sun Nov 16 1997 - 00:00:00 CET

Original text of this message