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 ...
随机推荐
- Codeforces round 419 div2 补题 CF 816 A-E
A Karen and Morning 水题 注意进位即可 #include<bits/stdc++.h> using namespace std; typedef long long i ...
- C# Web页面打印网页
<style media=print type="text/css"> .noprint{display:none} </style> 在打印时 ...
- 针对IE浏览器里面CSS的Bug解决方法
IE6双倍边距bug 当页面内有多个连续浮动时,如本页的图标列表是采用左浮动,此时设置li的左侧margin值时,在最左侧呈现双倍情况.如外边距设置为10px, 而左侧则呈现出20px,解决它的方法是 ...
- DFS和BFS模板
DFS: 该DFS框架以2D坐标范围为例,来体现DFS算法的实现思想 #include<cstdio> #include<cstring> #include<cstdli ...
- 思维题 Gym 100553A Alter Board
题目传送门 /* 题意:一个n×m的矩形,相邻的颜色不同,黑或白.问最少的翻转次数,每次翻转可指定任意一个子矩形 思维题:最少要把偶数行和列翻转,也就是n/2+m/2次 */ #include < ...
- ACM_Encoding
Encoding Time Limit: 2000/1000ms (Java/Others) Problem Description: 给定一个只包含'A' - 'Z'的字符串,我们可以使用以下方法对 ...
- 自定义View(11)**在onDraw中使用矩阵Matrix
1.代码示例 1.1 效果 原图 : 其尺寸为162 x 251,示例中的红点是变形的锚点. 变形之后: 1.2 代码 package com.e.weixin.session.view; impor ...
- APP增量更新
增量更新的概念: 当我们手机上安装的app版本与服务器的最新版本不一致的时候,传统做法是重新下载安装一个最新版的apk文件,不过这种方式比较耗流量,不利于用户体验.增量更新就是只下载当前app版本与最 ...
- Java实现三角形计数
题: 解: 这道题考的是穷举的算法. 一开始看到这道题的时候,本能的想到用递归实现.但使用递归的话数据少没问题,数据多了之后会抛栈溢出的异常.我查了一下,原因是使用递归创建了太多的变量, 每个变量创建 ...
- WinForm 对话框,流
private void button1_Click(object sender, EventArgs e) { //显示颜色选择器 colorDialog1.ShowDialog(); //把取到的 ...