1.select * from (select * from tablename order by
dbms_random.value) where rownum<
N;注:dbms_random是一个可以生成随机数值或者字符串的程序包。value()是最常用的,value()的用法一般有两个种,第...
分类:
数据库 时间:
2014-05-23 07:12:52
阅读次数:
364
昨天做了一张卡,是用于解决SQL注入问题的。现在就把昨天学到和用到的内容总结一下吧:)1.
什么是SQL注入简单的说,SQL注入是一种攻击行为,恶意的向SQL语句中插入某些内容进而达到某些不好的目的。举个例子吧,就是:statement =
"SELECT * FROM users WHERE na...
分类:
数据库 时间:
2014-05-23 06:43:48
阅读次数:
418
创建存储过程:1 delimiter //2 create procedure
printname (id int,out name char(50) )3 begin4 select user into name from user
where id=id;5 end6 //7 delimiter...
分类:
其他好文 时间:
2014-05-23 06:11:51
阅读次数:
184
Given n non-negative integers representing an
elevation map where the width of each bar is 1, compute how much water it is
able to trap after raining....
分类:
移动开发 时间:
2014-05-23 03:59:43
阅读次数:
364
MySQL中不支持对同一个表使用其查询结果更新or删除本表内数据(也就是update或delete后的where条件为针对相同表的select),解决方案是创建临时表做过度保存中间数据;可以直接使用查询结果来形成临时表Sql代码CREATETABLEtmpAS(SELECTcolumn1ASfiel...
分类:
数据库 时间:
2014-05-22 15:32:55
阅读次数:
300
【题目】
Given a collection of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T.
Each number in C may only be used once in the combination.
Note:
All numbers (including target) will be ...
分类:
其他好文 时间:
2014-05-21 15:55:25
阅读次数:
259
【题目】
Given a set of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T.
The same repeated number may be chosen from C unlimited number of times.
Note:
All numbers (including target) w...
分类:
其他好文 时间:
2014-05-21 15:21:28
阅读次数:
292
--将text替换成你要查找的内容
select name
from sysobjects o, syscomments s
where o.id = s.id
and text like '%text%'
and o.xtype = 'P'
--将text替换成你要查找的内容
SELECT ROUTINE_NAME, ROUTINE_DEFINITION
FROM INFO...
分类:
数据库 时间:
2014-05-21 14:50:04
阅读次数:
373
公司的数据库一直是sybase,用起来也挺好的,最新客户现场出现一个问题,数据无法传输了,看日志非常简单,一下就定位到了原因。
很简单,参数超过了2000个,因为这个功能是根据主表的主键查询子表,方法用的是where 主表id in (?,?,?,?……)方式,参数问号最多是是2000个,不过这就奇怪了,直接使用sql查询sybase,5000个参数也没问题,看来是jdbc驱动的问题了。...
分类:
数据库 时间:
2014-05-21 13:39:29
阅读次数:
463
分页使我们经常需要使用的功能,昨天在Spring MVC中实现了简单的分页操作和搜索分页,在此记录一下。使用的框架为(MyBatis+SpringMVC+Spring)。
首先我们需要一个分页的工具类:
1.分页
import java.io.Serializable;
/**
* 分页
*/
public class Page implements Seria...
分类:
编程语言 时间:
2014-05-21 13:38:03
阅读次数:
462