select 转换功能无效! Return语法错误?
the select convert function not working ! Return the syntax error?
我正在使用 DBeaver。这是我的一段代码:
select convert(varchar(10), updated_at, 101)
from rewards.mission_actions
limit 30
这是错误:
[42601]: ERROR: syntax error at or near ","
因为数据太具体,无法延长小时和分钟,所以我想更改它。不从中提取细节。
请帮忙或至少给我另一个解决方案。
CONVERT
函数用于 SQL 服务器,而不是 MySQL。 MySQL 中最接近的模拟是 DATE_FORMAT
:
SELECT DATE_FORMAT(updated_at, '%m/%d/%Y')
FROM rewards.missions_actions
-- ORDER BY <something>
LIMIT 30
我正在使用 DBeaver。这是我的一段代码:
select convert(varchar(10), updated_at, 101)
from rewards.mission_actions
limit 30
这是错误:
[42601]: ERROR: syntax error at or near ","
因为数据太具体,无法延长小时和分钟,所以我想更改它。不从中提取细节。
请帮忙或至少给我另一个解决方案。
CONVERT
函数用于 SQL 服务器,而不是 MySQL。 MySQL 中最接近的模拟是 DATE_FORMAT
:
SELECT DATE_FORMAT(updated_at, '%m/%d/%Y')
FROM rewards.missions_actions
-- ORDER BY <something>
LIMIT 30