当前位置: 代码迷 >> Sql Server >> myslq视图里支不支持union解决思路
  详细解决方案

myslq视图里支不支持union解决思路

热度:21   发布时间:2016-04-27 13:46:11.0
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));
这样写报错!请大侠指点!
  相关解决方案