SELECT * FROM carregisterinfo a WHERE (a.plate) IN ( SELECT plate FROM carregisterinfo GROUP BY plate HAVING count(*) >= 1 ) AND id IN ( SELECT max(id ...
分类:
数据库 时间:
2021-01-13 11:17:42
阅读次数:
0
问题:给定一个无符号整型的对象,统计其二进制序列中1的个数? 遍历: unsigned bit_count(unsigned x) { unsigned result=0; while(x){ result+=x&01?1:0; x>>=1; } return result; } 位运算: unsi ...
分类:
其他好文 时间:
2021-01-13 11:05:06
阅读次数:
0
Word Ladder (H) 题目 Given two words beginWord and endWord, and a dictionary wordList, return the length of the shortest transformation sequence from be ...
分类:
其他好文 时间:
2021-01-12 10:54:49
阅读次数:
0
数据是用InfluxDB来存储的,展示则是用Grafana来展示的 一、软件下载 1、Grafana下载链接(Windows版本):https://grafana.com/grafana/download?platform=windows 2、InfluxDB下载方式():https://porta ...
分类:
数据库 时间:
2021-01-11 11:16:29
阅读次数:
0
SELECT * FROM student stu WHERE ( SELECT COUNT(*) FROM student WHERE stu.classid=classid AND stu.grade >= grade GROUP BY classid HAVING COUNT(*)<=3 ) ...
分类:
数据库 时间:
2021-01-11 11:07:05
阅读次数:
0
好久没写博客了 这次准备在 cnblogs 和 我的博客 上同步更新~ # 题面 一个 \(n\) 个点 \(m\) 条边的 DAG,有若干个特殊点,边有权值。 一个单词定义为从点 \(1\) 出发到达一个特殊点的路径上,边权按访问顺序构成的一个序列。 \(Q\) 次询问,每次给出 \(k\),求所 ...
分类:
其他好文 时间:
2021-01-08 11:32:53
阅读次数:
0
运用你所掌握的数据结构,设计和实现一个 LRU (最近最少使用) 缓存机制 。 实现 LRUCache 类: LRUCache(int capacity) 以正整数作为容量?capacity 初始化 LRU 缓存 int get(int key) 如果关键字 key 存在于缓存中,则返回关键字的值, ...
分类:
其他好文 时间:
2021-01-08 11:17:57
阅读次数:
0
场景1:查询时间过长 select u.*,t.* (select sum(l.all_pl2) from TABLE_A l where 1 = 1 and l.tx_dt <= '20201223' and u.investor_id = l.investor_id) as sum_all_pl ...
分类:
数据库 时间:
2021-01-08 10:47:49
阅读次数:
0
select a.newname,count(b.id) from TableA a left join Tableb b on a.id = b.Tablea_id group by a.new_name TableA的主键是id Tableb的主键是id,关联A表的是Tablea_id字段 , ...
分类:
其他好文 时间:
2021-01-08 10:47:18
阅读次数:
0
几种获取记录数的方法 count(*): MySQL 优化过,扫描的行数小于总记录数。执行效率高。 count(1): 遍历所有记录,不取值,对每行尝试添加一个 “1” 列,如果不为 null,就计入累加(引擎层)。 count(主键): 遍历所有记录,并把每个记录的 id 取出返回 Server ...
分类:
其他好文 时间:
2021-01-07 11:59:09
阅读次数:
0