oracle 10g sql with 子句编译错误
编译错误显示“mm”和“cc”是无效标识符!
with m as (
select instructor,
count(*) as c
from class
group by instructor),
mm as (
select max(m.c) as cc
from m)
select m.instructor
from m
where m.c = mm.cc;
The compilation error says "mm" and "cc" is invalid identifier!
with m as (
select instructor,
count(*) as c
from class
group by instructor),
mm as (
select max(m.c) as cc
from m)
select m.instructor
from m
where m.c = mm.cc;
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
该错误是因为
mm
是子查询分解(AKA CTE)实例的名称,但正如您所看到的:您尚未将
mm
声明为mm
作为 <代码>m实例。使用:The error is because
mm
is the name of the Subquery Factoring (AKA CTE) instance, but as you can see:You haven't declared
mm
as a JOIN to them
instance. Use:我猜你是想找一位授课次数最多的教练。
你能不能不使用
I presume you are trying to get the instructer with the most classes.
Could you not use