mysql从入门到起飞+面试基础题

mysql基础

MySQL基础

企业面试题1

代码

sql 复制代码
select m.id,m.num 
from 
(
select t.id as id,count(1) num
from
(
select ra.requester_id as id
from RequestAccepted ra

union all
select ra.accepter_id as id
from RequestAccepted ra 
) t
group by t.id
) m
group by id
order by num desc,id 
limit 1

结果

总结

select from union union all where group by having order by limit

相关推荐
TG_yunshuguoji24 分钟前
阿里云国际代理:阿里云的云数据库是什么?
服务器·数据库·安全·阿里云·云计算
程序猿 董班长1 小时前
springboot配置多数据源(mysql、hive)
hive·spring boot·mysql
huazhixuthink1 小时前
PostgreSQL三种关闭方式的区别
数据库·postgresql
阿里小阿希6 小时前
Vue3 + Element Plus 项目中日期时间处理的最佳实践与数据库设计规范
数据库·设计规范
且行志悠7 小时前
Mysql的使用
mysql
白鹭7 小时前
MySQL源码部署(rhel7)
数据库·mysql
666和7777 小时前
Struts2 工作总结
java·数据库
还听珊瑚海吗7 小时前
SpringMVC(一)
数据库
野犬寒鸦8 小时前
力扣hot100:搜索二维矩阵 II(常见误区与高效解法详解)(240)
java·数据结构·算法·leetcode·面试