获取分组后取某字段最大一条记录 方法一:(效率最高) select * from test as a where typeindex = (select max(b.typeindex) from test as b where a.type = b.type ); 方法二:(效率次之) select a.* from test a, (select type,max(typeindex) typeindex from test group by type) b where a.type = b
### Py去除列表中小于某个数的值 print('*'*10,'Py去除列表中小于某个数的值','*'*10) nums = [2,3,4,10,9,11,19,14] print('*'*10,'remove之后改变了索引顺序,所以结果不正确!','*'*10) for i in nums: if i<5: nums.remove(i) print(nums) print('*'*10,'pop之后改变了索引顺序,所以结果不正确!','*'*10) for i in nums: if i<