This question shows research effort; it is useful and clear
0
This question does not show any research effort; it is unclear or not useful
Bookmark this question.
Show activity on this post.
是否可以在单个原子查询中执行以下行?
CREATE TABLE tmp AS
(
SELECT fooId, SUM(amount) AS amount
FROM foo
GROUP BY fooId
);
TRUNCATE TABLE foo;
INSERT INTO foo (SELECT fooId, amount FROM tmp);
DROP TABLE tmp;