Re: Oracle Problem from a beginner

From: Paul de Anguera <Paul.Deanguera_at_ci.seattle.wa.us>
Date: 1997/11/21
Message-ID: <3475EBCE.7097_at_ci.seattle.wa.us>#1/1


Chung Wing Tat Áéºa¹F wrote:
...
> 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...

For date ranges, we use a structure like this:

ref_no		varchar(8)
effdt		date

This way, the range is defined by the dates between a row's effective date and the next most recent row's effective date, and overlaps can't happen.

-- 
===============================================
"FROM" is disabled to stop junk mail (spam).
Please reply to:        +----------------------
Paul.Deanguera_at_ci.      |  Paul de Anguera
seattle.wa.us           |  ESD, City of Seattle
Received on Fri Nov 21 1997 - 00:00:00 CET

Original text of this message