Oracle的sql查询报错: ORA-00923未找到要求的 FROM 关键字,求大神帮忙看看哪里有问题!!
selecta,max(a1),max(a2)from(selecta,casewhenb='语文'thencelsenullendasa1,b='数学'thencels...
select a ,max(a1),max(a2)
from (
select a, case when b = '语文' then c else null end as a1,
b = '数学' then c else null end as a2
from
(select name a,subject b,score c from studentinfo) x
) y
group by a; 展开
from (
select a, case when b = '语文' then c else null end as a1,
b = '数学' then c else null end as a2
from
(select name a,subject b,score c from studentinfo) x
) y
group by a; 展开
3个回答
展开全部
select a, max(a1), max(a2)
from (select a,
case
when b = '语文' then
c
else
null
end as a1,
case
when b = '数学' then
c
else
null
end as a2
from (select name a, subject b, score c from studentinfo) x) y
group by a;
from (select a,
case
when b = '语文' then
c
else
null
end as a1,
case
when b = '数学' then
c
else
null
end as a2
from (select name a, subject b, score c from studentinfo) x) y
group by a;
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
select a, case when b = '语文' then c else null end as a1,
case when b = '数学' then c else null end as a2
case when b = '数学' then c else null end as a2
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
b = '数学' then c else null end as a2这句开头也要case when
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询