今日内容概要 如何查询表 """ select where group by having distinct order by limit regexp like ... """ 连表操作理论 今日内容详细 前期表准备 create table emp( id int not null unique ...
分类:
数据库 时间:
2020-06-14 12:46:59
阅读次数:
58
Odd Selection Subsequence Hate Game On Leaves Guess The Maximums Tree Shuffling A、Odd Selection 题意: $n$个数选$x$个数能不能使它们的和是奇数。 题解: 按奇偶分一波情况就行。 AC代码: 1 #i ...
分类:
其他好文 时间:
2020-06-13 14:33:52
阅读次数:
74
Week10(线性DP)拿数问题、LIS&LCS 思路分析: LIS(longest increasing subsequence)最长上升子序列,意思是一个序列中递增的序列最大个数。首先要理解子串和子序列的概念。 (1)字符子串指的是字符串中连续的n个字符,如abcdefg中,ab,cde,fg等 ...
分类:
其他好文 时间:
2020-06-13 11:03:25
阅读次数:
60
1.数据清洗 步骤: 1.查询charge_record表业务类型为充值且订单状态为成功的数据 2.将上述数据转移到本地数据库 使用如下脚本: # coding=utf-8import pymysql# 原数据库链接db1 = pymysql.connect( host='***', port=33 ...
分类:
数据库 时间:
2020-06-12 19:54:51
阅读次数:
89
题目链接:https://codeforces.com/problemset/problem/1365/E 题意 有 $n$ 个元素,定义大小为 $k$ 的集合值为 $\sum2^i$,其中,若集合内至少有 $max(1, k - 2)$ 个数二进制下第 $i$ 位为 $1$,则第 $i$ 位有效, ...
分类:
其他好文 时间:
2020-06-11 16:10:31
阅读次数:
84
HIVE count(distinct ) over() 无法使用解决办法 在使用hive时发现count(distinct ) over() 报错 hive> with da as ( > select 1 a, 'a' b union all > select 1 a, 'a' b union ...
分类:
其他好文 时间:
2020-06-11 14:58:24
阅读次数:
200
例子1:获取 Employee 表中第二高的薪水(Salary),没有第二高的则返回null select ifnull((select distinct Salary from Employee order by Salary desc limit 1, 1), null) as SecondHi ...
分类:
数据库 时间:
2020-06-11 14:57:32
阅读次数:
65
单表简单查询: select * from scott.emp 去重: --去除重复记录 select distinct ssex from java1227; select distinct (ssex) from java1227; 别名: --给指定字段指定别名 select ssid as ...
分类:
数据库 时间:
2020-06-10 11:26:14
阅读次数:
67
并发,二分法判断。 源码写的有点垃圾,有点乱,结果也存在一些缺失。 记录: sql:select distinct 中的distinct选项,这是只会获取你表中不重复数据,是表中,而不是你一次sql执行的结果显示中,原来一直记成一次执行结果中。 golang: 因为是并发,所以哪一位的字符先跑完是不 ...
分类:
数据库 时间:
2020-06-09 12:36:33
阅读次数:
73
存在一个表而不在另一个表中的数据 A、B两表,找出ID字段中,存在A表,但是不存在B表的数据。A表总共13w数据,去重后大约3W条数据,B表有2W条数据,且B表的ID字段有索引。 方法一 使用 not in ,容易理解,效率低 ~执行时间为:1.395秒~ select distinct A.ID ...
分类:
数据库 时间:
2020-06-08 19:23:39
阅读次数:
90