sql - Check constraint for start/end date -


i have table 'start_date' attribute , 'end_date' attribute. want create check constraint in oracle prevents end_date preceding start_date , start_date exceeding end_date. me out?

add check constraint:

alter table tablex   add constraint end_date_later_than_start_date_ck   -- sensible name                                                       -- constraint     check (start_date <= end_date)      <optional constraint state> ;  

the optional constraint states described in link. example, can specify enable novalidate, if want enable constraint future insertions (and updates) not check existing rows.


Comments