如何统计来自不同表的总行数并将其插入到结果表的列中。在MySQL中
Insert into hospitals(total_case)
Select count(*)
Id, count (id)
From Islamabad 发布于 2020-09-18 21:19:27
INSERT INTO语句中的列数应与SELECT子句中选择的列数匹配。
您已经选择了两列count(*) Id, count (id),但是想要在单列total_case中插入,这会产生错误。
INSERT INTO hospitals (total_case)
SELECT COUNT(id)
FROM Islamabad;https://stackoverflow.com/questions/63956487
复制相似问题