【发布时间】:2022-12-16 23:39:47
【问题描述】:
我尝试用表达式更新生成的列。它适用于选择
select from_unixtime(CONCAT(LEFT(jdoc->'$.ts', LENGTH(jdoc->'$.ts') - CHAR_LENGTH(jdoc->'$.sts')), jdoc->'$.sts')) as calc_ts
from table_name
但是当我改变桌子时它不起作用
alter table table_name
alter column sts_date set default from_unixtime(
CONCAT(LEFT(jdoc -> '$.ts', LENGTH(jdoc -> '$.ts') - CHAR_LENGTH(jdoc -> '$.sts')), jdoc -> '$.sts') /
1000);
它返回我的错误:
[42000][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 'from_unixtime( CONCAT(LEFT(jdoc -> '$.ts', LENGTH(jdoc -> '$.ts'' at line 2.
有什么问题吗?
【问题讨论】: