"table or view does not exist" 进入 Oracle 数据库
"table or view does not exist" Comming in Oracle DB
NAME PAYMENT
James 1000
Kepler 2000
Ronny 1300
Edward 1500
Patrick 1700
John 1660
Danny 1600
Hemry 1234
Harry 1236
select * 来自(
select * 来自学生 ) t1 其中 t1.payment=(select max(payment) from t1)
显示错误
select * 来自学生 where payment=(select max(payment) from student)
这是正确的
但是谁能解释一下为什么 t1 不正确? t1是where子句怎么用请告诉
with t1 as (select max(payment) payment from student )
select name, student.payment from student ,t1 where student.payment = t1.
CTE 可能是最简单的选择; T1
将是 CTE 本身,您可以在之后引用它:
with t1 as (select * from student)
select * from t1
where t1.payment = (select max(payment) from t1);
这会导致错误,因为 T1 不是 table,from 应该以 table 开头,您可以使用 Common Table Expression
例如
with ct as (
select 1,2 from dual )
select * from ct
在你的例子中
with st as ( select * from student)
select * from st where st.paymnet=(select max(payment) from st)
NAME PAYMENT
James 1000
Kepler 2000
Ronny 1300
Edward 1500
Patrick 1700
John 1660
Danny 1600
Hemry 1234
Harry 1236
select * 来自( select * 来自学生 ) t1 其中 t1.payment=(select max(payment) from t1)
显示错误
select * 来自学生 where payment=(select max(payment) from student)
这是正确的
但是谁能解释一下为什么 t1 不正确? t1是where子句怎么用请告诉
with t1 as (select max(payment) payment from student )
select name, student.payment from student ,t1 where student.payment = t1.
CTE 可能是最简单的选择; T1
将是 CTE 本身,您可以在之后引用它:
with t1 as (select * from student)
select * from t1
where t1.payment = (select max(payment) from t1);
这会导致错误,因为 T1 不是 table,from 应该以 table 开头,您可以使用 Common Table Expression
例如
with ct as (
select 1,2 from dual )
select * from ct
在你的例子中
with st as ( select * from student)
select * from st where st.paymnet=(select max(payment) from st)