我两次使用相同的选择查询。如何将其更改为一个查询或别名?
我的代码:
select *
from
(
select store, count(*) as quantity
from bbb
where MONTH(date) = 12
group by store
) as december
having quantity = (select MAX(maxi)
from
(
select store, count(*) as maxi
from bbb
where MONTH(date) = 12
group by store) as december
)