01 2013 档案

oracle的分析函数over 及开窗函数
摘要:eg: 相关解析:表t_pi_part字段 id code namevalue 1 222 avalue 2 222 bvalue 3 333 c给code相同的part code 添加行标,根据id 排序select p.* ,row_number()over(partition by p.code order order by a.id desc) as row_index from t_pi_part p;一:分析函数overOracle从8.1.6开始提供分析函数,分析函数用于计算基于组的某种聚合值,它和聚合函数的不同之处是对于每个组返回多行,而聚合函数对于每个组只返回一行。 下面通过 阅读全文

posted @ 2013-01-30 14:52 AlexGeng 阅读(539) 评论(0) 推荐(1)

Oracle 查询
摘要:-- 集合操作--union 并集 苏偶有内容都查询,重复的显示一次select * from emp union select * from emp20;--union all 并集 所有内容都显示 包括重复select * from emp union all select * from emp20;--intersect 交集select * from emp intersect select * from emp20;--minus 差集 只显示对方没有的 与顺序有关select * from emp minus select * from emp20;--子查询--单行子查询 s.. 阅读全文

posted @ 2013-01-24 15:35 AlexGeng 阅读(996) 评论(0) 推荐(1)

oracle 函数(一)
摘要:/*字符函数*/ /*变成大写*/ select Upper('abcde') from dual; /*变成小写*/ select lower('ADCSE') from dual; /*第一个字母变成大写*/ select Initcap('dkdkdkdkd') from dual; /*合并 阅读全文

posted @ 2013-01-24 12:12 AlexGeng 阅读(1509) 评论(5) 推荐(1)

导航