日期:2014-05-19  浏览次数:20616 次

这句SQL错在哪里了?
INSERT   INTO   data.d1
SELECT   *   FROM
(
SELECT   *   FROM   data.d2
UNION   ALL
SELECT   *   FROM   data.d3
UNION   ALL
);

------解决方案--------------------
INSERT INTO data.d1
SELECT * FROM
(
SELECT * FROM data.d2
UNION ALL
SELECT * FROM data.d3
UNION ALL
) t;

------解决方案--------------------
把*全部换成字段名就可以了
------解决方案--------------------
INSERT INTO data.d1
SELECT * FROM
(
SELECT * FROM data.d2
UNION ALL
SELECT * FROM data.d3
);

------解决方案--------------------
INSERT INTO data.d1
SELECT * FROM
(
SELECT * FROM data.d2
UNION ALL
SELECT * FROM data.d3
) t

或者

INSERT INTO data.d1
SELECT * FROM data.d2
UNION ALL
SELECT * FROM data.d3