此错误来自此代码,我无法找出问题所在;
#1411-错误的日期时间值:函数str_to_date的'11:00 PM'
CREATE TABLE OWNS (
STUDNO NUMERIC(9) NOT NULL,
ENAME CHAR(30) NOT NULL,
TYPE CHAR(15) NOT NULL,
OTIME TIME,
ODATE DATE,
ODRTN VARCHAR(7) NOT NULL,
CONSTRAINT OWNS_FOREIGN_KEY FOREIGN KEY (STUDNO) REFERENCES STUD(STUDNO));
INSERT INTO OWNS (STUDNO, ENAME, TYPE, OTIME,ODATE, ODRTN)
VALUES(123456789,'The Lion King','Anti', str_to_date('11:00 PM', '%l:%i
%p'), STR_TO_DATE('16-jan-2011', '%d-%b-%y'), 3)
感谢帮助,谢谢!!!
最佳答案
INSERT INTO OWNS (STUDNO, ENAME, TYPE, OTIME,ODATE, ODRTN)
VALUES(1234456789,'The Lion King','Anti', str_to_date('11:00 PM', '%l:%i
%p'), STR_TO_DATE("16-jan-2011", "%d-%b-%Y"), 3)