我正在尝试在MySQL v5.7.11中的TIMESTAMP函数中运行子查询。
SELECT TIMESTAMP(SELECT NOW() AS currentDate);
我收到错误说
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 'SELECT NOW() AS currentDate)' at line 1
我在这里做错了什么?
答案 0 :(得分:1)
您需要在子查询中添加额外的括号对。
SELECT TIMESTAMP((SELECT NOW() AS currentDate));