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

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -