更新时间:2023-11-29 13:20:16
您今天不能在检查约束中使用. 如官方文档所述:
You cannot use today in the check constraint. As the official documentation states:
检查约束是使用搜索条件定义的.搜索条件不能包含用户定义的例程,子查询,聚合,主机变量或rowid.此外,条件不能包含内置的变体函数CURRENT,USER,SITENAME,DBSERVERNAME或TODAY.
Check constraints are defined using search conditions. The search condition cannot contain user-defined routines, subqueries, aggregates, host variables, or rowids. In addition, the condition cannot contain the variant built-in functions CURRENT, USER, SITENAME, DBSERVERNAME, or TODAY.
我认为解决方案可以使用插入/更新触发器.
I think a solution can be using an insert/update trigger.