使用sql语句时date类型如何插入数据
Error Code: 1292. Incorrect date value: ‘1987’ for column ‘checkindate’ at row 1
我个人觉得有用简单的方法:
日期用单引号括起来,
eg:update bedmanage,patient set bedmanage.bedmessage='测试',floor_id=1,patient.checkindate='2030-12-31',patient.checkenddate='2006-10-02'where patient.fileno=bedmanage.fileno and patient.fileno=20000613;
当然我这里的checkindate是date类型的,我的MySQL数据库是8.0的,工具是workbench8.0。