2010年9月25日
摘要: http://blog.163.com/xxciof/blog/static/7978132720095193113752/ oracle中 connect by prior 递归算法 Oracle中start with...connect by prior子句用法 connect by 是结构化查询中用到的,其基本语法是: select ... from tablename start with... 阅读全文
posted @ 2010-09-25 20:06 新小白龙 阅读(94195) 评论(3) 推荐(6) 编辑
摘要: substr+instrSQL> with t as2(select 'aa,bbb,cccc' name from dual union all3select 'dsad,dll,dsad' from dual)4select substr(name,1,instr(name,',')-1) a,5 substr(name,instr(name,',')+1,instr(name,',',... 阅读全文
posted @ 2010-09-25 18:51 新小白龙 阅读(2728) 评论(0) 推荐(0) 编辑
摘要: 今天下午要写这样的一个脚本,统计最近三个月工号登录情况,要有总工号数,最近三个月登陆过的工号数,以及登陆率,时间函数我首先想到了add_moths这个函数,这没问题,统计要用到聚合函数中的count函数这个也没有问题,问题是我在想把总工号数和登陆过的工号数一起查出来的时候出了问题见下面错误写法,提示字段不是分组函数,后来在查询结果集中加了一个select 达到了效果和聚合函数一起查询出来的字段,那... 阅读全文
posted @ 2010-09-25 15:03 新小白龙 阅读(329) 评论(0) 推荐(0) 编辑