错误代码:1366。不正确的整数值:“Y”在第一行的“IsActive”列。

时间:2022-08-01 10:40:38

03:19:51 INSERT INTO students VALUES (NULL,'Craig','Franklin','1970-03-15','M','2010-05-30',3.10,'Y',null,3) 0.000 sec

在学生的价值观中插入(NULL,“Craig”,“Franklin”,“1970-03-15”,“M”,“2010-05-30”,“Y”,“Y”,“0,3”)。

INSERT INTO students VALUES (NULL,'Craig','Franklin','1970-03-15','M','2010-05-30',3.10,'Y',null,3);

插入学生的值(NULL,“Craig”,“Franklin”,“1970-03-15”,“M”,“2010-05-30”,3.10,“Y”,“NULL”,3);

SELECT * FROM students;

SELECT * FROM学生;

INSERT INTO students VALUES (NULL,'Harriet','Smith','1982-04-15','F','2010-05-30',3.22, 'Y',null,1);

插入学生值(NULL,“Harriet”,“Smith”,“1982-04-15”,“F”,“2010-05-30”,3.22,“Y”,NULL, 1);

SELECT * FROM students;

SELECT * FROM学生;

INSERT INTO students VALUES (NULL,'George','David','1984-11-05','M','2010-10-01',0.00, 'Y',null,3);

插入学生的值(NULL,'George','David','1984-11-05','M','2010-10-01',0.00, 'Y', NULL, 3);

SELECT * FROM students;

SELECT * FROM学生;

INSERT INTO students VALUES (NULL,'Ben','Jefferson','1976-09-25','M','2010-02-21',1.80, 'N','Student on temporary leave to pursue other opportunities but plans on returning in 1 year',3);

插入学生价值观(空、本、杰弗逊、1976-09-25、“M”、“2010-02-21”、1.80、“N”、“临时离校学生”等其他机会,但计划1年后返回);

SELECT * FROM students;

SELECT * FROM学生;

I changed IsActive to a bit(1) but I am still receiving an error in MySQL. I am trying to get IsActive to allow me place either 'Y' or 'Yes', 'N' or 'No'. I am also trying to insert the above: FirstName, LastName,BirthDate, Gender, StartDate, null for students currently enrolled and statement of withdrawal for last student, 1-4 for year enrolled in school. I've tables for courses and advisors without errors an don't know what is causing error in this INSERT statement.

我改变了IsActive到一个比特(1),但是我仍然在MySQL中收到错误。我试着让IsActive允许我使用Y或Yes, N或No。我还试图插入上面的名字:FirstName, LastName,BirthDate, Gender, StartDate, null for students当前注册的学生和最后一个学生的退学声明,1-4年入学。我的课程和顾问没有错误的表格,不知道在这个INSERT语句中是什么导致了错误。

Do I need to change IsActive to VARCHAR(5)? this is the error I receive: 03:19:51 INSERT INTO students VALUES (NULL,'Craig','Franklin','1970-03-15','M','2010-05-30',3.10,'Y',null,3) Error Code: 1366. Incorrect integer value: 'Y' for column 'IsActive' at row 1 0.000 sec

我是否需要将IsActive改为VARCHAR(5)?这是我收到的错误:03:19 . 51插入学生的值(NULL,“Craig”,“Franklin”,“1970-03-15”,“M”,“2010-05-30”,3.10,“Y”,NULL, 3)错误代码:1366。不正确的整数值:“Y”表示列“IsActive”的第1行0.000秒。

I'm not sure how to correct this error.

我不知道该如何纠正这个错误。

1 个解决方案

#1


0  

isActive column expect integer value but you entered string value('Y'). Please try 1, 0, etc.

isActive列期望整数值,但您输入了字符串值('Y')。请尝试1、0等等。

#1


0  

isActive column expect integer value but you entered string value('Y'). Please try 1, 0, etc.

isActive列期望整数值,但您输入了字符串值('Y')。请尝试1、0等等。