平凡的人5
平凡的人5
全部文章
分类
题解(61)
归档
标签
去牛客网
登录
/
注册
平凡的人5的博客
全部文章
(共7篇)
题解 | #按照数量和价格排序#
select quantity ,item_price from OrderItems order by quantity desc ,item_price desc; 1、单列排序,默认升序,降序后面接"DESC"即可 2、多列排序,首先按字段一字段排序,若字段一相等,则按字段二排序 3、自定义排...
Mysql
2022-04-26
0
451
题解 | #提取博客URL中的用户名#
select device_id,substring(blog_url,11) user_name from user_submit /* 一、mysql截取字符串函数 1、left(str,length) 从左边截取length 2、right(str,length)从右边截取length 3、...
Mysql
2022-04-26
0
393
题解 | #21年8月份练题总数#
用户数 根据用户分组 题目总数,?未分组? select count(did_cnt) , sum(question_cnt) from (select count(device_id) did_cnt,count(question_id) question_cnt from question_p...
Mysql
2022-04-26
0
256
题解 | #分组排序练习题#
select university , avg(question_cnt) avg_question_cnt from user_profile group by university order by avg_question_cnt; 认真审题,发现没有注意到排序
Mysql
2022-04-26
0
249
题解 | #分组过滤练习题#
select university,avg(question_cnt) avg_question_cnt,avg(answer_cnt) avg_answer_cnt from user_profile group by university having avg_question_cnt <...
Mysql
2022-04-26
0
245
题解 | #查找最晚入职员工的所有信息#
/不会日期函数了,用一个子查询/ select emp_no ,birth_date, first_name, last_name, gender, hire_date from employees where hire_date=(select max(hire_date) from employ...
Mysql
2022-04-16
1
228
题解 | #分组计算练习题#
/* 我总感觉这么写怪怪的,group by 有的学一下啊*/ select gender ,university ,count(1) as user_num, sum(active_days_within_30)/count(1) as avg_active_day, sum(question_c...
Mysql
2022-04-15
0
277