日期:2014-05-18  浏览次数:20600 次

myslq视图里支不支持union
语句为:
CREATE VIEW mainview(ID) 
  AS
((SELECT ID FROM student)
  UNION (SELECT ID FROM teacher));
这样写报错!请大侠指点!

------解决方案--------------------
CREATE VIEW mainview(ID)
AS
SELECT ID FROM student
UNION 
SELECT ID FROM teacher;
------解决方案--------------------
探讨

CREATE VIEW mainview(ID)
AS
SELECT ID FROM student
UNION
SELECT ID FROM teacher;

------解决方案--------------------
探讨
语句为:
CREATE VIEW mainview(ID)
AS
((SELECT ID FROM student)
UNION (SELECT ID FROM teacher));
这样写报错!请大侠指点!