mysql 笛卡尔积
摘要:简介 新生成的表的行数 第一个表的行数 * 第二个表的行数 参考链接 mysql 必知必会
阅读全文
posted @
2021-07-30 16:12
HDU李少帅
阅读(100)
推荐(0) 编辑
mysql 外键
摘要:简介 一直没有很好的理解外键. 下面的参考链接写的很好. 简单来说, 子表引用主表的主键, 这样, 子表只能插入主表已经存在的主键值. 可以在数据的一致性做的比较好. 参考链接 https://www.cnblogs.com/chenhaoyu/p/5890195.html
阅读全文
posted @
2021-07-30 16:10
HDU李少帅
阅读(25)
推荐(0) 编辑
写参考文献有感
摘要:简介 可以通过两大好用的网站 https://www.engineeringvillage.com/ https://www.webofscience.com/ 不过这两个网站都是要机构付费才能进行查询. 可以通过万方, 一直觉得万方不套路, 使用的是PDF简介明了. 如何使用总结的很好 https
阅读全文
posted @
2021-07-22 15:57
HDU李少帅
阅读(51)
推荐(0) 编辑
堆排序 使用 algorithm
摘要:简介 show code code #include <set> #include <vector> #include <list> #include <iostream> #include <memory> #include <algorithm> using namespace std; int
阅读全文
posted @
2021-07-18 09:22
HDU李少帅
阅读(36)
推荐(0) 编辑
deque STL 深入剖析 TODO
摘要:简介 deque 对于插入和删除的性能代价远小于 vector 但是这是存在一定代价的. 参考链接 https://blog.csdn.net/wk_bjut_edu_cn/article/details/83714965
阅读全文
posted @
2021-07-16 15:15
HDU李少帅
阅读(41)
推荐(0) 编辑
leetcode 901 股票价格跨度
摘要:简介 简单 code class StockSpanner { public: vector<int> v; vector<int> vv; StockSpanner() { //vector<int> v; } int next(int price) { v.push_back(price); i
阅读全文
posted @
2021-07-14 22:01
HDU李少帅
阅读(26)
推荐(0) 编辑
Eclipse jvm 调优
摘要:简介 TODO 参考 周志明 eclipse jvm 调优后的参数配置 与 简单注释 -vm D:/_DevSpace/jdk1.6.0_21/bin/javaw.exe -startup plugins/org.eclipse.equinox.launcher_1.0.201.R35x_v2009
阅读全文
posted @
2021-07-07 12:47
HDU李少帅
阅读(56)
推荐(0) 编辑
vscode 回退
摘要:简介 配置 Go Back / Go Forward 个人必须配置这两个否则会十分不爽.
阅读全文
posted @
2021-07-06 23:16
HDU李少帅
阅读(452)
推荐(0) 编辑
遇见linux端运行qt程序报错, Could not find the Qt platform plugin “xcb“ in ““ This application failed to st
摘要:简介 .zshrc 里面进行设置 export QT_QPA_PLATFORM_PLUGIN_PATH=/mnt/hdd1/software/qt5_12_0/5.12.0/gcc_64/plugins/platforms 其中路径为自己设定的路径
阅读全文
posted @
2021-07-06 21:44
HDU李少帅
阅读(1347)
推荐(0) 编辑
小米手机4 rom 下载链接
摘要:简介 https://krunk.cn/kblog563.html
阅读全文
posted @
2021-07-06 13:23
HDU李少帅
阅读(56)
推荐(0) 编辑
java 两个线程交替打印到100
摘要:简介 使用 volatile code /** * Created by lee on 2021/7/5. */ public class Counter { static volatile int flag = 0; public static void main(String[] args){
阅读全文
posted @
2021-07-05 16:56
HDU李少帅
阅读(160)
推荐(0) 编辑
获取积分最多的人(二)
摘要:简介 select user.id, user.name,t.grade_sum from ( select user_id,sum(grade_num) as grade_sum from grade_info group by user_id having grade_sum = ( selec
阅读全文
posted @
2021-07-01 16:17
HDU李少帅
阅读(119)
推荐(0) 编辑
刷题通过的题目排名
摘要:简介 联表查询, 相当于 inner join? 不是 因为不能用on select a.id, a.number, count(distinct b.number) as t_rank from passing_number as a, passing_number as b where a.nu
阅读全文
posted @
2021-07-01 15:54
HDU李少帅
阅读(55)
推荐(0) 编辑
考试分数(二)
摘要:简介 第二个select一定要起一个别名,否则会出错 注意子查询 select a.id, a.job, a.score from grade as a left join ( select job, avg(c.score) as score from grade as c group by c.
阅读全文
posted @
2021-07-01 15:53
HDU李少帅
阅读(28)
推荐(0) 编辑
牛客的课程订单分析(二)
摘要:简介 select user_id from ( select id, user_id, product_name, status, client_id, date, count(1) over (partition by user_id) as num from order_info where
阅读全文
posted @
2021-07-01 15:08
HDU李少帅
阅读(51)
推荐(0) 编辑
牛客的课程订单分析(三)
摘要:简介 select id, user_id, product_name, status, client_id, date from ( select id, user_id, product_name, status, client_id, date, count(1) over (partitio
阅读全文
posted @
2021-07-01 15:07
HDU李少帅
阅读(56)
推荐(0) 编辑
牛客的课程订单分析(六)
摘要:简介 from 接 子查询 count(1) 统计个数 over (partition by user_id) 以user_id 进行分区 left join on 后面还可以加上where select a.id, a.is_group_buy, b.name as client_name fro
阅读全文
posted @
2021-07-01 14:53
HDU李少帅
阅读(47)
推荐(0) 编辑
实习广场投递简历分析(二)
摘要:简介 考察DATE_FORMAT 与 group 联立 order by 联立 select job, DATE_FORMAT(date, '%Y-%m') as mon, sum(num) as cnt from resume_info where date like '2025%' group
阅读全文
posted @
2021-07-01 12:00
HDU李少帅
阅读(49)
推荐(0) 编辑
最差是排第几名?
摘要:简介 考察 over 从一行到另一行?? 先暂时这么记忆吧 select grade, sum(number) over(order by grade) t_rank from class_grade order by grade;
阅读全文
posted @
2021-07-01 11:51
HDU李少帅
阅读(34)
推荐(0) 编辑
合并字符串 sql
摘要:简介 select concat(last_name, ' ', first_name) as Name from employees;
阅读全文
posted @
2021-07-01 11:40
HDU李少帅
阅读(105)
推荐(0) 编辑
批量插入数据
摘要:简介 INSERT INTO actor values (1, 'PENELOPE', 'GUINESS', '2006-02-15 12:34:33'), (2, 'NICK', 'WAHLBERG', '2006-02-15 12:34:33')
阅读全文
posted @
2021-07-01 11:38
HDU李少帅
阅读(38)
推荐(0) 编辑
删除emp_no重复的记录,只保留最小的id对应的记录。
摘要:简介 删除emp_no重复的记录,只保留最小的id对应的记录。 DELETE FROM titles_test where id not in( select * from( select MIN(id) from titles_test group by emp_no )as a )
阅读全文
posted @
2021-07-01 11:34
HDU李少帅
阅读(59)
推荐(0) 编辑
将id=5以及emp_no=10001的行数据替换成id=5以及emp_no=10005,其他数据保持不变,使用replace实现,直接使用update会报错。
摘要:简介 修改数据 update titles_test set emp_no = replace(emp_no, 10001, 10005) where id = 5; update titles_test set to_date = NULL, from_date ='2001-01-01' whe
阅读全文
posted @
2021-07-01 11:30
HDU李少帅
阅读(45)
推荐(0) 编辑
修改表名 sql
摘要:简介 alter table titles_test rename to titles_2017;
阅读全文
posted @
2021-07-01 11:17
HDU李少帅
阅读(114)
推荐(0) 编辑
出现三次以上相同积分的情况
摘要:简介 having 的使用考察 select number from grade group by number having count(number) >= 3;
阅读全文
posted @
2021-07-01 11:13
HDU李少帅
阅读(46)
推荐(0) 编辑
找到每个人的任务
摘要:简介 left join select a.id, a.name, b.content from person as a left join task as b on b.person_id = a.id order by a.id;
阅读全文
posted @
2021-07-01 11:12
HDU李少帅
阅读(30)
推荐(0) 编辑
牛客每个人最近的登陆日期
摘要:简介 简单 select user_id, max(date) from login group by user_id order by user_id;
阅读全文
posted @
2021-07-01 11:04
HDU李少帅
阅读(54)
推荐(0) 编辑
考试分数(一)
摘要:简介 使用 round 与 avg select job, round(avg(score),3) as avg from grade group by job order by avg desc;
阅读全文
posted @
2021-07-01 11:00
HDU李少帅
阅读(25)
推荐(0) 编辑
牛客的课程订单分析(一)
摘要:简介 使用 多个 and 并列 select * from order_info where date > "2025-10-15" and status = "completed" and product_name in("C++","Java","Python") order by id;
阅读全文
posted @
2021-07-01 10:50
HDU李少帅
阅读(44)
推荐(0) 编辑
实习广场投递简历分析(一)
摘要:简介 select job, sum(num) as cnt from resume_info where resume_info.date < '2026-01-01' and resume_info.date >= '2025-01-01' group by job order by cnt d
阅读全文
posted @
2021-07-01 10:49
HDU李少帅
阅读(48)
推荐(0) 编辑
sql 查找最晚入职员工信息
摘要:简介 order by 然后 limit select * from employees order by hire_date desc limit 1;
阅读全文
posted @
2021-07-01 10:36
HDU李少帅
阅读(63)
推荐(0) 编辑