[英]Mysql Alter table using concat
These SQLs should be give same result? 这些SQL应该给出相同的结果吗? Second one gives an error (SQL Error 1064).
第二个给出错误(SQL错误1064)。
Correct : ALTER TABLE table1 TRUNCATE PARTITION d20;
Does not work : ALTER TABLE table1 TRUNCATE PARTITION concat('d', '20');
Actually I stuck on truncate table with respect to day of month, (ie today is 25th) execute 实际上,我相对于一个月的日期停留在截断表上(即今天是25日)执行
i was planned sql like below, but does not work 我像下面那样计划了sql,但不起作用
ALTER TABLE table1 TRUNCATE PARTITION DAYOFMONTH(now());
No, they shouldn't. 不,他们不应该。
TRUNCATE PARTITION
accepts a partition name, which is not a string. TRUNCATE PARTITION
接受分区名称,该名称不是字符串。
UPD : UPD :
You still can create and perform dynamic sql queries using PREPARE
+ EXECUTE
您仍然可以使用
PREPARE
+ EXECUTE
创建和执行动态sql查询
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.