题解 | #所有用户对高难度题目的刷题数#
所有用户对高难度题目的刷题数
https://www.nowcoder.com/practice/e8b66c069376405bb7524b217c890b23
#所有用户:所连接user_profile
select a.device_id,
convert(sum(ifnull(c.difficult_level,0)='hard'),signed) as "question_cnt"
from user_profile a
left join question_practice_detail b
on a.device_id =b.device_id
left join question_detail c
on b.question_id=c.question_id
group by a.device_id
order by question_cnt;
为什么这里去除小数点位数不能用round函数呢?
不能哦那个round函数的情况如果是整形数据的话,可以考虑使用函数类型转换函数
convert(value,type)

查看11道真题和解析