mysql语句的简化:from中的临时表作为where中的条件 10
select*from(selecttype,count(*)numfrom(selectm.type,count(*)numfromtoutticketotk,tron...
select * from
(select type,count(*) num from
(select m.type,count(*) num from toutticket otk,tronda r,tmovie m
where otk.uname='user2'
and otk.rid=r.aid
and r.mid=m.mid
group by uuid
)temp
group by type desc)res
where num =
(select max(num) from
(select type,count(*) num from
(select m.type,count(*) num from toutticket otk,tronda r,tmovie m
where otk.uname='user2'
and otk.rid=r.aid
and r.mid=m.mid
group by uuid
)temp
group by type desc)res)
;
上部分的res怎样写才可作为where num中的条件参数 展开
(select type,count(*) num from
(select m.type,count(*) num from toutticket otk,tronda r,tmovie m
where otk.uname='user2'
and otk.rid=r.aid
and r.mid=m.mid
group by uuid
)temp
group by type desc)res
where num =
(select max(num) from
(select type,count(*) num from
(select m.type,count(*) num from toutticket otk,tronda r,tmovie m
where otk.uname='user2'
and otk.rid=r.aid
and r.mid=m.mid
group by uuid
)temp
group by type desc)res)
;
上部分的res怎样写才可作为where num中的条件参数 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询