06 2012 档案
摘要:NVL (expr1, expr2)->expr1为NULL,返回expr2;不为NULL,返回expr1。注意两者的类型要一致NVL2 (expr1, expr2, expr3) ->expr1不为NULL,返回expr2;为NULL,返回expr3。expr2和expr3类型不同的话,expr3会转换为expr2的类型NULLIF (expr1, expr2) ->相等返回NULL,不等返回expr1
阅读全文
摘要:select Next_Day(LAST_DAY(SYSDATE),'星期日') from dual;select Next_Day(LAST_DAY(SYSDATE),1) from dual;
阅读全文
摘要:select instr('abc','a') from dual;select instr('abc','bc') from dual;select instr('abc ab','a',1,2) from dual;select instr('abcab','a',-1,2) from dual;select instr('abc','d') from dual;分别返回12510select instr('abcab
阅读全文
摘要:ORACLE SQL 函数 INITCAP() INITCAP() 假设c1为一字符串.函数INITCAP()是将每个单词的第一个字母大写,其它字母变为小写返回. 单词由空格,控制字符,标点符号等非字母符号限制. select initcap('hello world') from dual; 结果 INITCAP('HE ----------- Hello World select initcap('汉ello world,汉elloworld,hello汉world,hello 汉world') from dual; 结果 INITCAP('
阅读全文
摘要:oracle trunc函数使用介绍核心提示:oracle trunc函数使用介绍 1.TRUNC(for dates) TRUNC函数为指定元素而截去的日期值。 其具体的语法格式如下: TRUNC(date[,fmt]) 其中: date 一个日期值 fmt 日期格式,该日期将由指定的元素格式所截去。忽略它则由最近的日期截去 下面是该函数的使用情况: TRUNC(TO_DATE('24-Nov-1999 08:00 pm'),'dd-mon-yyyy hh:mi am') ='24-Nov-1999 12:00:00 am' TRUNC(TO_
阅读全文
摘要:适用情况: oracle 对查询结果进行排序时,被排序的栏位存在null值,且要指定NULL值排在最前面或者最后面 关键字:Nulls First;Nulls Last 大>,null值排在最後;desc 降序小>,null值排在最前面)" onmouseout="this.style.backgroundColor='#fff'">默认情况:null 默认为最大值(即:asc 升序<小-->大>,null值排在最后;desc 降序<大-->小>,null值排在最前面) 指定: 1. Oracl
阅读全文
摘要:DML = Data Manipulation Language,数据操纵语言,命令使用户能够查询数据库以及操作已有数据库中的数据的计算机语言。具体是指是UPDATE更新、INSERT插入、DELETE删除。 DML包括:INSERT、UPDATE、DELETE。注意,select语句属于DQL(Data QueryLanguage)。DDL(Data Definition Language)数据定义语言DDL:数据定义语句,用于定义SQL模式、基本表、视图和索引的创建和撤消操作。英语说明:DDL is Data Definition Language statements. Some ex.
阅读全文
摘要:通过有with check option的视图操作基表(只是面对单表),有以下结论:首先视图只操作它可以查询出来的数据,对于它查询不出的数据,即使有基表,也不可以通过视图来操作1、对于update,有with check option,要保证修改后的数据可以通过试图查询出来2、对于insert,有with check option,要保证插入后的数据可以通过试图查询出来3、对于delete,有没有with check option 都一样对于没有where语句的视图 with check option 是多余的
阅读全文
摘要:Rows cannot be deleted through a view if the view definition contains the DISTINCT keyword
阅读全文
摘要:You can define constraints syntactically in two ways:As part of the definition of an individual column or attribute. This is called inline specification.As part of the table definition. This is called out-of-line specification.NOT NULL constraints must be declared inline. All other constraints can .
阅读全文

浙公网安备 33010602011771号