怪问题:视图定义中没有输出列或 FROM 子句中没有项目
打算新建一视图,但出错了,提示:视图定义中没有输出列或 FROM 子句中没有项目
代码如下:
SELECT id,num
FROM table1
WHERE num > 0
UNION ALL
SELECT id,qt as num
FROM table2
WHERE qt > 0
------解决方案----------------------try
create view VI
as
SELECT id,num
FROM table1
WHERE num > 0
UNION ALL
SELECT id,qt as num
FROM table2
WHERE qt > 0