首页 > 解决方案 > Add a constraint so one date is not less than or equal to the other date in the same table in MySQL

问题描述

I am on Server version: 5.6.10-log - MySQL Community Server (GPL)

When I try to add this constrain I don't get an error, but it doesn't prevent the dates from failing the rule:

ALTER TABLE events ADD CONSTRAINT check_dates check (events.end_datetime <= events.extended_end_datetime);

Is it my server version? Is there any way to do this on my current version of mysql?

标签: mysql

解决方案


推荐阅读