在insert语句MySQL中选择UUID()
我试图在插入查询中使用在insert语句MySQL中选择UUID(),mysql,Mysql,我试图在插入查询中使用SELECT UUID()。 这是我的生日礼物 INSERT INTO `posts`(`post_id`, `user_id`, `content`, `time`) VALUES (SELECT uuid(),1,'my content',mytime) 我得到一个错误在uuid附近需要一个逗号或一个右括号uuid是一个函数,您无需编写select即可自行使用 INSERT INTO `posts`(`post_id`, `user_id`, `content`, `
SELECT UUID()
。
这是我的生日礼物
INSERT INTO `posts`(`post_id`, `user_id`, `content`, `time`) VALUES (SELECT uuid(),1,'my content',mytime)
我得到一个错误
在uuid附近需要一个逗号或一个右括号
uuid
是一个函数,您无需编写select即可自行使用
INSERT INTO `posts`(`post_id`, `user_id`, `content`, `time`) VALUES (uuid(),1,'my content',mytime)
或者,我想您可以删除
值(
和)