用Sql Server找出一天数据中从第一条数据开始每累加1小时的数据 -- ============================================= -- Author: Allen Cai -- Create date: 2018-07-20 15:59 -- ============================================= ALTER PROCEDURE PLMS_A_Logistics_Test AS BEGIN DECLARE @i INT;
在日常生活方面,我们经常需要记录一些操作,类似于日志的操作,最后的记录才是有效数据,而且可能它们属于不同的方面.功能下面,从数据库的术语来说,就是查找出每组中的一条数据. 例子 我们要从上面获得的有效数据为: 对应的sql: select * from t1 t where id = (select top 1 id from t1 where grp = t.grp order by createtime desc )
387. 字符串中的第一个唯一字符 给定一个字符串,找到它的第一个不重复的字符,并返回它的索引.如果不存在,则返回 -1. 案例: s = "leetcode" 返回 0. s = "loveleetcode", 返回 2. 注意事项:您可以假定该字符串只包含小写字母. class Solution { public int firstUniqChar(String s) { //fast int n = s.length(); for(int i = 'a'; i
从list中取固定条数的数据放入新的list里 public static <T> List<List<T>> split(List<T> resList, int count) { if (resList == null || count < 1) return null; List<List<T>> ret = new ArrayList<List<T>>(); int size = resList.