Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/65.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Mysql 在SQL 1错误代码中创建表。1241_Mysql - Fatal编程技术网

Mysql 在SQL 1错误代码中创建表。1241

Mysql 在SQL 1错误代码中创建表。1241,mysql,Mysql,在MySQL中创建表时遇到一些问题。我似乎不明白我犯了什么错误。这是我的代码 create table customerDim( CustomerID int not null auto_increment primary key, FirstName varchar(30) not null, LastName varchar(30) not null, Gender char(1) not null, Street1 varchar(100) no

在MySQL中创建表时遇到一些问题。我似乎不明白我犯了什么错误。这是我的代码

create table customerDim(
    CustomerID int not null auto_increment primary key,
    FirstName varchar(30) not null, 
    LastName varchar(30) not null, 
    Gender char(1) not null,
    Street1 varchar(100) not null,
    Street2 varchar(100) null,
    City varchar(30) not null,
    StateAbbrev char(2) not null,
    Zipcode char(5) not null, 
    PrimaryPhone varchar(10) not null,
    EmailAddress varchar(50) null,
    constraint GenderCheck check (Gender in ('F','M')),
    constraint ZipCheck check (Zipcode NOT LIKE ('%[0-9]%',5)),
    constraint PhoneCheck check (PrimaryPhone NOT LIKE ('%[0-9]%',10)),
    constraint PhoneCheck2 check(LENGTH(PrimaryPhone)=10)
    );

获取错误代码:241。操作数应包含1列。

在类似和不类似的操作数之后,5和10是什么?
like
运算符需要一个字符串参数,您可以提供某种类型的列表,其中包含
('%[0-9]',5)
。这个语法来自哪里?Omg,即SQL Server语法。我把它们拿了出来,它成功了!非常感谢你!在MySQL中使用
zipcoderlike'^[0-9]{5}$'