Oracel
文章平均质量分 62
水中鸟lgl
这个作者很懒,什么都没留下…
展开
-
oracle sql日期比较
oracle sql日期比较:共三部分:第一部分:oracle sql日期比较:http://www.blogjava.net/forker/archive/2007/09/07/143467.html#Post第二部分:Oracle 获取当前日期及日期格式http://blog.sina.com.cn/s/blog_6168ee920100l2ye.html第三部转载 2015-06-24 13:33:49 · 387 阅读 · 0 评论 -
oracel游标循环取值实例
1、loop循环取游标的值--定义游标declare cursor test_cursor is select * from t_pstu_reginfo where rownum tab test_cursor%rowtype;---定义游标变量 begin open test_cursor; loop fetch test_cursor in原创 2015-07-13 14:07:12 · 1204 阅读 · 0 评论 -
oracle存储过程与游标使用实例
create or replace procedure CLOSE_DIRECT_AUDIT_POINT(pointname in varchar2, new_pointname in varchar2) is v_audit_id NUMBER(38); v_n原创 2015-07-13 13:32:08 · 474 阅读 · 0 评论 -
oracle 存储过程
1、简单存储过程实例1、只有输入参数create or replace procedure to_first_test (param1 in varchar2,param2 varchar2) isbegindbms_output.put_line('param1='||param1);end; 调用beginto_first_test('310113200901原创 2015-07-13 12:54:59 · 309 阅读 · 0 评论 -
oracle复制表结果与数据,以及创建临时表
1. 复制表结构及其数据: create table table_name_new as select * from table_name_old2. 只复制表结构: create table table_name_new as select * from table_name_old where 1=2;或者: create table table_name_ne原创 2015-06-12 16:36:15 · 4870 阅读 · 0 评论 -
MySql将一个表的数据导入到另一个表
将一个表的数据插入到另外一个表中的几种情况如下:1.如果2张表的字段一致,并且希望插入全部数据,可以用这种方法: INSERT INTO 目标表 SELECT * FROM 来源表; 例如:insert into insertTest select * frominsertTest2;2.如果只希望导入指定字段,可以用这种方法: INSERT INTO原创 2015-06-10 09:48:45 · 11170 阅读 · 3 评论 -
oracle sequences在sql中取值
1、oracle的sequencesequences在sql中取值" TITLE="oracle sequences在sql中取值" />2、从临时表中去sequences的值,例子:<<insert id="insNoticeInfo"parameterType="com.vsc.zsxt.dao.model.TNoticeInfo">> <<selectKey re原创 2015-06-10 09:52:50 · 1373 阅读 · 0 评论 -
oracle instr()
1、instr(string1,string2[,start_position[,nth_appearence]])string1:要在此字符串中查找。string2:要在string1中查找的字符串。start_position:从string1开始查找的位置。可选,默认为1,正数时,从左到右检索,负数时,从右到左检索。nth_appearence:查找第几次出现string2。原创 2015-06-10 09:52:45 · 316 阅读 · 0 评论 -
MyBatis的foreach语句
在Mybatis的xml配置中使用集合,主要是用到了foreach动态语句。foreach的参数:foreach元素的属性主要有item,index,collection,open,separator,close。item表示集合中每一个元素进行迭代时的别名.index指定一个名字,用于表示在迭代过程中,每次迭代到的位置.open表示该语句以什么开始,separator表示在每次进原创 2015-06-10 09:52:42 · 412 阅读 · 0 评论 -
Oracel汉字占几个字节
1、查看oracleserver端字符集 select userenv('language') from dual; 如果显示如下:SIMPLIFIEDCHINESE_CHINA.ZHS16GBK,一个汉字占用两个字节 如果显示如下:SIMPLIFIEDCHINESE_CHINA.AL32UTF8,一个汉字占用三个字节可以用以下语句查询原创 2015-06-10 09:49:52 · 730 阅读 · 0 评论 -
oracle 中sql的查询条件有NULL的处理
1、错误判断:变量名如:select t.rylx,t.* from t_pstu_reginfo t where t.rylx因为rylx 是一个永假式,即查询结果为空2、正确判断:变量名 is not null or is NULLselect t.rylx,t.* from t_pstu_reginfo t where t.rylx is not原创 2015-06-30 12:51:19 · 654 阅读 · 0 评论 -
SQL里的EXISTS与in、not exists与not in
1、exists 与 in最大的区别exists : 强调的是是否返回结果集,不要求知道返回什么, 比如: select name from student where sex = 'm' andmark exists(select1 from grade where ...),只要exists引导的子句有结果集返回,那么exists这个条件就算成立了,大家注意返回的字段原创 2015-06-10 09:52:47 · 296 阅读 · 0 评论 -
mysql,sqlServer与oracle分页查询语句
1、mysql分页查询语句 select * from tableName where 条件 limit 当前页码*页面容量-1 , 页面容量Limit用法如下:第一个参数是指要开始的地方,第二个参数是指每页显示多少条数据;注意:第一页用0表示。例如: select pname from product limit 0,2;2、oracle原创 2015-06-28 15:53:33 · 666 阅读 · 0 评论 -
日期函数 MONTHS_BETWEEN
格式:MONTHS_BETWEEN(DATE1,DATE2) 即MONTHS_BETWEEN(日期1,日期2) MONTHS_BETWEEN函数返回两个日期之间的月份数。如果两个日期月份内天数相同,或者都是某个月的最后一天,返回一个整数,否则,返回数值带小数,以每天1/31月来计算月中剩余天数。如果日期1比日期2小 ,返回值为负数。 例:months_bet原创 2015-06-29 13:52:18 · 2923 阅读 · 1 评论 -
oracle行转列及效果
1、wmsys.wm_concatOracle中的wmsys.wm_concat主要实现行转列功能(说白了就是将查询的某一列值使用逗号进行隔开拼接,成为一条数据)。2、LISTAGG 这是最基础的用法:LISTAGG(XXX,XXX) WITHIN GROUP( ORDER BY XXX) 用法就像聚合函数一样,通过Group by语句,把每个Group的一原创 2015-06-26 18:02:15 · 695 阅读 · 0 评论 -
oracle中translate与replace的区别
1、TRANSLATE语法: TRANSLATE(string,from_str,to_str) 二、目的 返回将(所有出现的)from_str中的每个字符替换为to_str中的相应字符以后的string。TRANSLATE 是 REPLACE 所提供的功能的一个超集。如果 from_str 比 to_str 长,那么在 from_str 中而不在 to_str 中的额外字符将从原创 2015-07-14 16:42:37 · 1374 阅读 · 0 评论