Oracle learning note
oracle SQL
select 'para1' || 'para2' as "para" must ""
select count(*),c.id,c.name count(*) not use with "group by" count total rows number,otherwise "count(*)" always equal 1
from table t
where c.name in ('test1','test2') group by c.name,c.id having count() show data group by "count(*)","id","name",selected fields must equal to group by fields except count(*) (select a.p1 as ap,b.p2 as bp from tablea a join tableb b on a.id = b.id) tablec combine a&b to c select (sysdate - c.date) *24 *60 as d,round(123.456, 0) r return 123,返回小数点后面0位
from test
where nvl(arg,00)<> 23; 代表如果前面的arg的值为null那么返回的值为后面的00,oracle不等于标准写法<> select distinc * from table t where 1<>1 只取table结构,不取值
select * from table t where 1=1 用于动态创建sql语句以至于不会报错 trunc(123.45),trunc(sysdate,'mm') 函数截取时不进行四舍五入2017/1/1 18:00:00 会显示为2017/1/1
round(123.456, 2) 函数截取时进行四舍五入
to_char(sysdate,'mon')
substr(para,-1,2) 截取para从最后1个字母开始数的2个字母
to_date('2017-08-09','yyyy-MM-dd')
sign(p1-p2) 函数根据某个值是0、正数还是负数,分别返回0、1、-1
select a.* from A a where exists (select b.* from B b) 适合B表比A表数据大的情况,因为exists()会执行A.length次,它并不缓存exists()结果集 if v_name='vickey' then
dbms_output.put_line('success!');
else
dbms_output.put_line('failed');
end if;
decode(filed,ifval1,thensetval1,ifval2,thensetval2,...,else)
Oracle learning note的更多相关文章
- Learning Note: SQL Server VS Oracle–Database architecture
http://www.sqlpanda.com/2013/07/learning-note-sql-server-vs.html This is my learning note base on t ...
- Learning note for Binding and validation
Summary of my learning note for WPF Binding Binding to DataSet. when we want to add new record, we s ...
- Course Machine Learning Note
Machine Learning Note Introduction Introduction What is Machine Learning? Two definitions of Machine ...
- shell learning note
shell learning note MAIN="/usr/local/" # 变量大写 STATUS="$MAIN/status" # 美元符加字符串是 ...
- Oracle Study Note : Users and Basic Security
1. view the default user account SQL> select username from dba_users; 2. lock all users and set t ...
- Oracle Study Note : Tablespace and Data Files
1.how to create a tablespace that employs the most common features create tablespace tb_name #create ...
- 2014/09/30 Learning Note
Vbird Linux: Vim Learning: http://linux.vbird.org/linux_basic/0310vi.php Bash Shell: http://linux.vb ...
- [Angular2] @Ngrx/store and @Ngrx/effects learning note
Just sharing the learning experience related to @ngrx/store and @ngrx/effects. In my personal opinio ...
- Machine Learning Note Phase 1( Done!)
Machine Learning 这是第一份机器学习笔记,创建于2019年7月26日,完成于2019年8月2日. 该笔记包括如下部分: 引言(Introduction) 单变量线性回归(Linear ...
随机推荐
- 利用http_load测试Web引擎性能
http_load是基于linux平台的性能测试工具,它体积非常小,仅100KB.它以并行复用的方式运行,可以测试web服务器的吞吐量与负载. 一.获得http_load httpd_load的官方站 ...
- css模型
外边距: margin:1px 2px 3px 4px; 上 右 下 左 内边距: padding:1px 2px 3px 4px; 上 右 下 左 边 ...
- 洛谷P1552 [APIO2012]派遣(左偏树)
传送门 做这题的时候现学了一波左偏树2333(好吧其实是当初打完板子就给忘了) 不难发现肯定是选子树里权值最小的点且选得越多越好 但如果在每一个点维护一个小根堆,我们得一直找知道权值大于m为止,时间会 ...
- _bzoj2049 [Sdoi2008]Cave 洞穴勘测【LCT】
传送门:http://www.lydsy.com/JudgeOnline/problem.php?id=2049 裸的LCT,保存LCT模版.说一下出bug的几个地方叭: ①,rotate时,没有判断 ...
- AC自动机 HDOJ 5384 Danganronpa
题目传送门 /* 题意:多个文本串,多个模式串在每个文本串出现的次数 AC自动机:这就是一道模板题,杭电有道类似的题目 */ /************************************ ...
- 字符串处理 BestCoder Round #43 1001 pog loves szh I
题目传送门 /* 字符串处理:是一道水题,但是WA了3次,要注意是没有加'\0'的字符串不要用%s输出,否则在多组测试时输出多余的字符 */ #include <cstdio> #incl ...
- Service官方教程(11)Bound Service示例之2-AIDL 定义跨进程接口并通信
Android Interface Definition Language (AIDL) 1.In this document Defining an AIDL Interface Create th ...
- Asp.Net识别手机访问
在VS创建WEB应用程序时会有一个微软开发的典型web应用程序 在根目录有个用户控件用来实现切换手机和电脑 其中有个微软开发的类和方法用来专门判断移动设备和桌面设备 在Microsoft.AspNet ...
- Windows10系统切换JDK版本(前提是装了多个版本的JDK)
由于是直接截屏,等我回过头来整理的时候忘记了文章原来的出处, 如作者本人看到,如有侵权,请联系删除!
- Program received signal SIGILL, Illegal instruction
Program received signal SIGILL, Illegal instruction 这个错误,发现是直接在printf 的%s中直接使用string类型,而没有使用c字符串格式造成 ...