
数据库
zero8500
10万个为什么??
展开
-
sql中字符串型数字排序
原有表中的点击次数用的是 字符串型,现要求按点击次数排序,select * from table t order by t.click desc查出的是按左对齐排序的99979897837而我要求的是按数字大小排的序要修改为select * from table t order by cast (t.click as int) desc78原创 2008-02-28 16:33:00 · 9118 阅读 · 4 评论 -
在SqlServer2005 中自定义一个 Split函数与C#中的Split功能一样
1create function split(@SourceSql varchar(8000),@Code varchar(10)) 2returns @temp table(sp varchar(1000)) 3--实现split功能 的函数 4--date :2007-7-10 5--Author :sp 6as 7begin 8 declare @i int 9转载 2008-04-25 17:43:00 · 1947 阅读 · 3 评论 -
批量生成insert into语句(带有数据)
function StorePage(){d=document;t=d.selection?(d.selection.type!=None?d.selection.createRange().text:):(d.getSelection?d.getSelection():);void(keyit=window.open(http://www.365key.com/stor转载 2008-04-25 17:55:00 · 686 阅读 · 0 评论 -
求合计和百分比 数据库查询
下面是一个统计的数据库查询,建立了两个临时表,对数据做操作。还有就是求百分比的操作select distinct 行政单位 =casewhen 行政区=440608 then 一区when 行政区=440607 then 二区when 行政区=440606 then 三区when 行政区=440605 then 四区原创 2008-08-23 16:13:00 · 1294 阅读 · 0 评论 -
一段SQL记录
--(2)查是否有计费主表无计费明细表-- --2SELECT * --into #1FROM hd_核定单WHERE (核定单号 NOT IN (SELECT 核定单号 FROM hd_核定单明细))select * from hd_核定单明细declare @单号 varchar(255)declare @企业编号 varchar(255)decl原创 2008-10-25 11:11:00 · 751 阅读 · 1 评论