B站3月24日校招笔试SQL题

SELECT
CASE
		
	WHEN
		t1.score >= 85 THEN
			'非常满意' 
			WHEN t1.score >= 70 THEN
			'满意' 
			WHEN t1.score >= 60 THEN
			'接受' ELSE '不满意' 
		END AS 'like',
		count( t1.user_id ) AS 'total',
		ROUND( SUM( t2.under_time - t2.log_time )/ COUNT( t1.user_id )/ 100, 3 ) AS 'time' 
	FROM
		user_action_tb AS t1
		JOIN login_tb AS t2 ON t1.user_id = t2.user_id 
	GROUP BY
		`like` 
ORDER BY
	`total` DESC;

题目不太记得了,大概思路是这样,当时死活不记得 SQL 语法 CASE 用法,导致做题 0 分,

#如果校招重来我最想改变的是#
全部评论
什么岗位呀
点赞 回复 分享
发布于 03-25 13:23 陕西
佬,什么岗位呀
点赞 回复 分享
发布于 03-25 13:48 上海

相关推荐

评论
3
5
分享
牛客网
牛客企业服务