摘要: 1.获取重复的数据; 2, 只保留最小的rowid delete from apex_qualitymonitordetail a where a.barcode in (select barcode from apex_qualitymonitordetail d group by barcode 阅读全文
posted @ 2017-05-19 16:47 大善若龙 阅读(154) 评论(0) 推荐(0) 编辑
摘要: int total = dgList.RowCount; int count = total / 500; int num = total % 500; if (num > 0) { count = count + 1; } for (int i = 0; i < count; i++) { Dat 阅读全文
posted @ 2017-05-08 16:59 大善若龙 阅读(1549) 评论(0) 推荐(0) 编辑
摘要: 过滤指定的字符串,一字符串有重复的数据内容,所以需要去掉重复的内容,subst()截取 起止下标;instr()获取终止下标位置 例如:substr(p.address, 0, instr(p.address, '-', 1, 1)-1) ); case when length(substr(p.a 阅读全文
posted @ 2017-04-27 16:11 大善若龙 阅读(797) 评论(0) 推荐(0) 编辑
摘要: 将查询的结果翻译成其他值,类似 case when to_char(创建时间,'mm') ='01' then '查询统计的是1月 ' when to_char(创建时间,'mm') ='02' then '查询统计的是2月 ' when to_char(创建时间,'mm') ='03' then 阅读全文
posted @ 2016-07-25 17:18 大善若龙 阅读(167) 评论(0) 推荐(0) 编辑
摘要: 根据月份统计数据(mm=月 , yyy=年; q =季 iw =周; ): 统计某一年某一月的数据,如,查询2015(1-12月) 到 2016(1-12月) 的每一月的数据 select count(to_char(创建时间,'yyyy-mm')) as tiemdate,to_char(创建时间 阅读全文
posted @ 2016-07-25 17:07 大善若龙 阅读(2623) 评论(0) 推荐(0) 编辑
摘要: 映射的集合不包含方法: 1.xml中(namespace)命名空间路径写错了,2.xml中 sql 方法的id 写错了,3.xml文件名和所写的mapper名称不相同(没测试过,一般文件名称都是一样的), 4.在dao的实现类中,有继承其它的类, 所以要到继承的类所对应的xml文件中写sql语句指定 阅读全文
posted @ 2016-06-29 10:44 大善若龙 阅读(280) 评论(0) 推荐(0) 编辑
摘要: --like select * from user where name like CONCAT('%',CONCAT(#{names,jdbcType=VARCHAR},'%' )) -in 传集合 <select id="name" resultType="xxxxx"> select * fr 阅读全文
posted @ 2016-06-29 09:53 大善若龙 阅读(165) 评论(0) 推荐(0) 编辑
摘要: --with as 如果子查询很多,或者 "一个字段"需要用到子查询中的"多个字段" with TT as( select A.运单编号, K.发件地 , (select 所属财务中心 from tab_营业网点表 c where A .目的网点=c.网点编号) as 目的地公司, (select 阅读全文
posted @ 2016-06-29 09:39 大善若龙 阅读(143) 评论(0) 推荐(0) 编辑
摘要: 1. 创建异常类,并继承Exception, 在类中创建构造方法,传入参数(参数为要输出的异常内容); 2. 创建一个执行异常的逻辑类,捕获异常, 阅读全文
posted @ 2016-06-29 09:34 大善若龙 阅读(145) 评论(0) 推荐(0) 编辑
摘要: //1 创建日期格式 Date old = new Date(); Date news = new Date(); //2 设置日期格式 SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); old=sdf.parse(" 阅读全文
posted @ 2016-06-29 09:09 大善若龙 阅读(1265) 评论(0) 推荐(0) 编辑