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 ... 
随机推荐
- softmax regression in c++
			#include <iostream>#include <vector>#include <cmath>#include <algorithm>#inc ... 
- js中&&与||
			1.a&&b 先将a.b转化为Boolean型,在进行逻辑运算,true 返回b,false 返回a: 2.a||b 先将a.b转化为Boolean型,在进行逻辑运算,true 返回a ... 
- HDU 3944 DP? (Lucas定理)
			题意:在杨辉三角中让你从最上面到 第 n 行,第 m 列所经过的元素之和最小,只能斜向下或者直向下走. 析:很容易知道,如果 m 在n的左半部分,那么就先从 (n, m)向左,再直着向上,如果是在右半 ... 
- Spring Shell简单应用
			大致:想要使用Spring Shell,则项目需要是 Spring Boot项目,下面贴出结构和代码 1.POM依赖 <?xml version="1.0" encoding ... 
- E20170521-ts
			redirect vt. 使改寄,更改(信件等)姓名地址; 改变方向,改变线路; 重新寄送; teletype n. 电传打字机,电报交换机,打字电报通讯; descriptor n. 描述符; ... 
- jquery中document.ready在两类浏览器中的区别[转]
			DOMready的构建方法不再重复,现代浏览器通过DOMContentLoaded来实现,IE通过readystatechange+doScroll来模拟该方法. 类似jquery中的document ... 
- Qt事件系统之三:键盘事件
			QKeyEvent类用来描述一个键盘事件.当键盘按键被按下或者被释放时,键盘事件便会被发送给拥有键盘输人焦点的部件. QKeyEvent的key()函数可以获取具体的按键,对于Qt中给定的所有按键,可 ... 
- _bzoj1010 [HNOI2008]玩具装箱toy【斜率优化dp】
			传送门:http://www.lydsy.com/JudgeOnline/problem.php?id=1010 裸的斜率优化,第一次写队首维护的时候犯了个智障错误,队首维护就是维护队首,我怎么会那队 ... 
- Android SQLite(2)如何判断表是否已经存在
			在sql语句中用 if not exists void create_table(){ SQLiteDatabase dbWireter = dbhelper.getWritableDatabase( ... 
- for循环的阶乘
			方法一: long sum=0; long num=1; for (long i = 1; i <=20; i++) { for(long j=i;j>0;j--){ num=num*j; ... 
