![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数据库
卷起裤腿过河
这个作者很懒,什么都没留下…
展开
-
oracle行转列 case when 语句
使用case when 语句 方便处理一些需要进行行转列,统计方面的一些数据 需要自己查看decode函数 with a as ( select t.*, case when t.attretion1 = '1' then '1' when t.attretion1 = '2' then '2' end plan_status from table_name t where 1=1--(...原创 2018-11-19 17:31:39 · 1798 阅读 · 0 评论 -
关于Mapper文件中日期比较
对于同一天内不能用>=或者<=查出同一天的数据 可以使用to_number函数和to_char来实现完成 sql写法: to_number(to_char(sysdate,'yyyyMMdd')) >= 20180102(类似的时间格式数据) Mapper中写法 to_number(to_char(“时间字段”,'yyyyMMdd')) >= to_number(to_c...原创 2019-01-17 13:29:53 · 7646 阅读 · 0 评论 -
Oracle递归查询方法
应用:一张表中存在父子关系 可以使用Oracle提供的递归查询方法: ep:select t.id from tale_name t start with t.id = #{值} connect by t.party_id = prior t.id原创 2019-01-21 14:18:05 · 266 阅读 · 0 评论