创建视图时,SQL语句
不可以包含子查询的吗???
例如:
CREATE VIEW view_name
AS
SELECT [...]
FROM
(
SELECT [...]
FROM [...]
WHERE [...]
)
WHERE [...]
执行上述SQL语句会报错,假如要创建如上视图,有没有什么好的解决方案呢???
今天无意中遇到上述问题,麻烦各位给个建议,蟹蟹,^_^...
PHP中文网2017-04-17 16:27:10
A common subquery is written as follows
select ename,deptno,sal
from emp
where deptno=(select deptno from dept where loc='NEW YORK');
Is yours an inline graph subquery? Can you post the wrong statement? Below is an example
SELECT ename,job,sal
FROM (SELECT ename,job,sal FROM EMP ORDER BY sal);
迷茫2017-04-17 16:27:10
It’s not that it’s impossible, but some methods and features cannot be used. You’d better post the SQL and let people see it