Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Oracle Problem from a beginner
Hello every body!
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 overlapping date range in all rows so I want to setup following constraint 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 I do it by table constraint? and how can I distinguish the field between the 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 CST
![]() |
![]() |