全部评论
SELECT Id,COUNT(CASE WHEN Category='hotel' THEN Id END) As HotelOrdCnt,COUNT(CASE WHEN Category='flight' THEN Id END) As FlightOrdCnt,AVG(Amount) As AvgAmount FROM Detail WHERE OrderDate LIKE '2019-%' GROUP BY Id ;
我做啦~我只会这一道!!! 不过没有截图。。大概回忆了一下 如果有大佬发现不对欢迎指教! 大概是 select id, sum(case when category='hotel' then 1 else 0 end) as hotel, sum(case when category=flight' then 1 else 0 end) as flight, avg(amount) from detail where substr(orderdate,1,4)='2019' group by id order by id
蹲一个第二题的代码😂
一共a了2.42
总共a了2.24能过笔试吗
不知道为啥 没全过
相关推荐
点赞 评论 收藏
分享