问题遇到的现象和发生背景
插入datetime字段,不使用单引号插入不成功
问题相关代码,请勿粘贴截图
insert into tb_shop(owner_id,area_id,shop_category_id,shop_name,shop_desc,shop_addr,phone,shop_img,priority, create_time,last_edit_time,enable_status,advice) values (1, 4, 1, 111, 123, 2222, 3333, null, null, 2022-04-14 22:02:07.913, 2022-04-14 22:02:09.769, 0, null)
报错:
1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '22:02:07.913, 2022-04-14 22:02:09.769, 0, null)' at line 1, Time: 0.000000s
改成这种就可以成功:insert into tb_shop(owner_id,area_id,shop_category_id,shop_name,shop_desc,shop_addr,phone,shop_img,priority, create_time,last_edit_time,enable_status,advice) values (1, 4, 1, 111, 123, 2222, 3333, null, null, '2022-04-14 22:02:07.913', '2022-04-14 22:02:09.769', 0, null)
运行结果及报错内容
我的解答思路和尝试过的方法
我想要达到的结果
求帮忙答疑,谢谢