CREATE TABLE customer (
date_of_birth date NOT NULL
);
Run Code Online (Sandbox Code Playgroud)
试图使某人在将值插入表中时不能输入小于 18 岁的年龄。我将如何使用 date_of_birth 属性执行此操作?
注意:我知道如何使用 CHECK(age > 18),但我不知道如何将它与 date_of_birth 属性合并。
我在将以下代码转换为for循环时遇到了一些麻烦.代码的目的是检查字符串中是否包含字母和数字.
else if (!string.Any(Char.IsLetter) || !string.Any(Char.IsDigit))
{
return false;
}
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?