--向内容发指令;declareint_count number(10);beginint_count := 0; for cc in (select t.*,t.rowid from w902053.tmp_shengchanduchu_zc t where t.flag ='sendOK' an...
分类:
数据库 时间:
2015-09-15 14:31:45
阅读次数:
505
1、查找表中多余的重复记录,重复记录是根据单个字段(peopleId)来判断 select * from people where peopleId in (select peopleId from people group by peopleId having count(peopleId) > ...
分类:
数据库 时间:
2015-09-15 14:20:35
阅读次数:
166
if exists(select * from test.dbo.test1 where a='1')beginprint('exists ')endelse begin print('no exists ') endgo
分类:
数据库 时间:
2015-09-15 12:58:23
阅读次数:
145
既然做分页,首先要写好sql语句。1、notin --SQL2000select top 10 * from huochetou where id not in (select top 10 id from huochetou)2、row_number() --SQL2005select * fro...
分类:
其他好文 时间:
2015-09-15 12:24:44
阅读次数:
134
1、XML 的实现1.1 定义SQL映射xml文件 insert into users(name, age) values(#{name}, #{age}); delete from users where id=#{id} update users set name=#{name},age=#{a...
分类:
其他好文 时间:
2015-09-15 10:42:58
阅读次数:
179
Problem:Given a binary tree where all the right nodes are either leaf nodes with a sibling (a left node that shares the same parent node) or empty, fl...
分类:
其他好文 时间:
2015-09-15 06:56:07
阅读次数:
147
1、sp_helptext: 显示规则,默认值,为加密的存储过程,用户定义函数,触发器或视图2、根据字段名查询数据库中的某表名 select [name] from sysobjects where [id] in (select[id] from syscolumns where [nam...
分类:
数据库 时间:
2015-09-14 22:34:39
阅读次数:
272
select * from (select *,row_number() over(order by createon desc) as rownum from AKCatLog ) as t where t.rownum between 0 and 10select * from AKCatLo....
分类:
数据库 时间:
2015-09-14 22:34:31
阅读次数:
170
using System;using System.Collections.Generic;using System.Linq;using System.Text;/*from let where子句* 1、from 后面接的是查询主体,可以有任何数量个,指定了额外的数据集合并引入了要在之后运算的迭...
分类:
其他好文 时间:
2015-09-14 20:54:54
阅读次数:
193
use Testgoif exists(SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'gettime') AND type in (N'FN', N'IF', N'TF', N'FS', N'FT'))-- 判断是否存在该自定义函数d...
分类:
数据库 时间:
2015-09-14 19:25:54
阅读次数:
337