码迷,mamicode.com
首页 >  
搜索关键字:having where    ( 21164个结果
SQL AND & OR 运算符
AND 和 OR 运算符用于基于一个以上的条件对记录进行过滤。AND 和 OR 运算符AND 和 OR 可在 WHERE 子语句中把两个或多个条件结合起来。假设第一个条件和第二个条件都成立,则 AND 运算符显示一条记录。假设第一个条件和第二个条件中仅仅要有一个成立,则 OR 运算符显示一条记录。原...
分类:数据库   时间:2014-05-26 23:47:25    阅读次数:379
ORACLE随机查询
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注入
昨天做了一张卡,是用于解决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
[LeetCode] [Trapping Rain Water 2012-03-10]
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使用查询结果生成临时表
MySQL中不支持对同一个表使用其查询结果更新or删除本表内数据(也就是update或delete后的where条件为针对相同表的select),解决方案是创建临时表做过度保存中间数据;可以直接使用查询结果来形成临时表Sql代码CREATETABLEtmpAS(SELECTcolumn1ASfiel...
分类:数据库   时间:2014-05-22 15:32:55    阅读次数:300
sqlserver分页查询
SQL Server 2005引入的新方法。SELECT * FROM (SELECT ROW_NUMBER() OVER(ORDER BY keyField DESC) AS rowNum, * FROM tableName) AS t WHERE rowNum > start AND rowNu...
分类:数据库   时间:2014-05-22 14:22:58    阅读次数:351
LeetCode: Combination Sum II [039]
【题目】 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
LeetCode: Combination Sum [038]
【题目】 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
jdbc查询sybase参数过多问题
公司的数据库一直是sybase,用起来也挺好的,最新客户现场出现一个问题,数据无法传输了,看日志非常简单,一下就定位到了原因。 很简单,参数超过了2000个,因为这个功能是根据主表的主键查询子表,方法用的是where 主表id in (?,?,?,?……)方式,参数问号最多是是2000个,不过这就奇怪了,直接使用sql查询sybase,5000个参数也没问题,看来是jdbc驱动的问题了。...
分类:数据库   时间:2014-05-21 13:39:29    阅读次数:463
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!