上一页 1 ··· 70 71 72 73 74 75 76 77 78 ··· 89 下一页
摘要: 语法:ROW_NUMBER() OVER(PARTITION BY COLUMN ORDER BY COLUMN) 简单的说row_number()从1开始,为每一条分组记录返回一个数字,这里的ROW_NUMBER() OVER (ORDER BY xlh DESC) 是先把xlh列降序,再为降序以 阅读全文
posted @ 2016-02-11 11:36 BloggerSb 阅读(249) 评论(0) 推荐(0)
摘要: 如果支除空元素,可以使用Split参数StringSplitOptions.RemoveEmptyEntries去实现 用法: string[] inputpids = productIds.IndexOf(',') > 0 ? productIds.Split(',').Distinct().To 阅读全文
posted @ 2016-02-11 11:35 BloggerSb 阅读(8140) 评论(0) 推荐(0)
摘要: delete from 表 where id not in(select min(id) from 表 group by name ) //删除重复名字的记录 删除之前请用语句 select * from 表 where id in(select min(id) from 表 group by na 阅读全文
posted @ 2016-02-09 21:28 BloggerSb 阅读(812) 评论(0) 推荐(0)
摘要: 封装成onlyNum(),onlyAlpha()和onlyNumAlpha()3个Jquery扩展方法,方便复用,由于里面一些JS代码涉及到了"禁用输入法,获取剪切板的内容",而"禁用输入法,获取剪切板的内容"只能在IE浏览器下才有效,对于别的浏览器是无效的,因此这三个方法只适合在IE浏览器下使用才 阅读全文
posted @ 2016-02-08 18:52 BloggerSb 阅读(533) 评论(0) 推荐(0)
摘要: //json对象数组按对象属性排序 function JsonSort(obj, field, sortby) { this.obj = obj; this.field = field; this.sortby = sortby; } JsonSort.prototype.sort = functi 阅读全文
posted @ 2016-02-08 18:51 BloggerSb 阅读(355) 评论(0) 推荐(0)
摘要: function ReplaceSeperator(mobiles) { var i; var result = ""; var c; for (i = 0; i < mobiles.length; i++) { c = mobiles.substr(i, 1); if (c == ";" || c 阅读全文
posted @ 2016-02-08 18:08 BloggerSb 阅读(595) 评论(0) 推荐(0)
摘要: 常用的方法有:子查询、ROW_NUMBER、APPLY,总体感觉还是ROW_NUMBER比较直观 一. 取分组中第1行(最大/最小值)1. 取出分组中某列最大/最小值,不要求显示其他列最常见的分组聚合,用group by 分组时,只有参加分组/聚合的列才可以被显示。 2. 取出分组中某列最大/最小值 阅读全文
posted @ 2016-02-08 18:08 BloggerSb 阅读(1076) 评论(0) 推荐(0)
摘要: 常见的SQL拼接 id =3; "select * from orders where employeeid="+id; 这样存在的问题是相当明显的就是SQL注入,如果需要参数化那在编写代码的时候就相对多了些工作。 自动参数化处理 id=3; SQL sql="select * from order 阅读全文
posted @ 2016-02-08 12:06 BloggerSb 阅读(1827) 评论(0) 推荐(0)
摘要: 随着SQL Server版本的升级,常用的方法有三种:TOP,ROW_NUMBER,OFFSET/FETCH NEXT。 一. TOP (1) 利用order by正反排序 declare @page_no int declare @page_size int select * from (sele 阅读全文
posted @ 2016-02-08 12:05 BloggerSb 阅读(479) 评论(0) 推荐(0)
摘要: string num=12num.PadLeft(4, '0'); //结果为为 '0012' 看字符串长度是否满足4位,不满足则在字符串左边以"0"补足 public string OrderCode { get { var result = string.Empty; if (CreateTim 阅读全文
posted @ 2016-02-08 11:43 BloggerSb 阅读(977) 评论(0) 推荐(0)
上一页 1 ··· 70 71 72 73 74 75 76 77 78 ··· 89 下一页