sql--分页

摘要: createprocsp_proInfo_paging(@pageSizeint=7,@pageNoint=1)asbegindeclare@totalCountintset@totalCount=(selectCOUNT(*)fromPROJECT_INFO)if@pageNo>CEILING(@totalCount*1.0/@pageSize)beginset@pageNo=@pageNo%@pageSizeif@pageNo=0beginset@pageNo=1endend;withtempas(selectROW_NUMBER()over(orderbyp.PROJECT_ID) 阅读全文
posted @ 2013-02-03 16:48 Amity 阅读(130) 评论(0) 推荐(0)

sql--批量更新

摘要: 替换掉表中旧的projectid值declare@atable(oldnvarchar(20),newnvarchar(20))insertinto@avalues('1000066175','1000071422')insertinto@avalues('1000068732','1000071995')updatedbo.FORECASTsetPROJECT_ID=b.newfromFORECASTinnerjoin@a bonFORECAST.Project_Id=b.old 阅读全文
posted @ 2013-02-03 16:46 Amity 阅读(124) 评论(0) 推荐(0)

sql--找含有制定字符列的表

摘要: 在数据库中找到含有指定字符列的表selectdistincttab.namefromsys.columnscolleftjoinsys.tablestaboncol.object_id=tab.object_idwherecol.namelike'%district%'andtab.nameisnotnull 阅读全文
posted @ 2013-02-03 16:43 Amity 阅读(90) 评论(0) 推荐(0)

sql--转置

摘要: select*from(selecta.PROJECT_ID,a.REVENUE,a.FORECAST_MONTHfromFORECAST a)pPIVOT(SUM(REVENUE)FORFORECAST_MONTHIN([1],[2],[3],[4],[5],[6],[7],[8],[9],[10],[11],[12]))C 阅读全文
posted @ 2013-02-03 16:41 Amity 阅读(146) 评论(0) 推荐(0)

Jquery小记

摘要: 1前台获取dropdownlistvarcurrentChannels=$('#ddlCurrentChannel').find("option");for(vari=0;i<currentChannels.length;i++) {if(currentChannels[i].selected==true) {districtCode.val(currentChannels[i].value);}}<asp:DropDownListrunat="server"ID="ddlCurrentChannel"Wi 阅读全文
posted @ 2013-02-03 16:37 Amity 阅读(156) 评论(0) 推荐(0)