一次sql排序的问题。

时间:2024-01-17 21:30:02

一次sql排序的问题。

select date, count(fail) as fail,count(win) as win from
(select date,(case (result) when 'fail' then 'fail' end ) as fail,(case (result) when 'win' then 'win' end ) as win from games
) d group by date

一次sql排序的问题。

select Name, Year , Month ,Count(Amount) as Income from
(select b.Name ,a.[Year] as Year ,a.[Month] as Month ,a.Amount as Amount from Test_Amount a left join Test_Users b on a.UserId=b.Id )
c group by Name,Year,Month