1,练习题一:以66分割,大于部分一个键值对,小于部分一个键值对 li = [23,78,67,45,34,89,67,78,23,23] lig = [] lil = [] dic = {} for i in li: if i == 66: continue elif i > 66: lig.append(i) else: lil.append(i) dic.setdefault("k1",lig) dic.setdefault("k2",lil) prin…
不啰嗦,直接上图,大概实现效果如下: 有上面这样一份数据,将他们按照userAccount和submitTime进行分组,然后提前每组数据的前两条记录 提取后数据如下: 实现的SQL如下: select t.* from (select *,row_number() over(partition by userAccount, submitTime order by submitTime) rn from demoTable) t @_@! 结束啦~~…