如何在创建表时对age < 40 from birthdate
设置检查约束? 喜欢的东西:从出生日期开始sql check约束的年龄
SELECT DATEDIFF(yy,” Birthdate ”, getdate()) as age
age<40
然后,我怎么可能有另一个检查约束创建表时计数的属性,它的分组和检查,如果是“6?
如下面但作为检查约束?创建表时
select count(attributex) as counter from entityx
group by attributex
having counter>6
我删除了不兼容的数据库标记。你有MySQL和Oracle,但代码是SQL Server。 –