oracle 平常使用总结

-- 删除重复数据里面前面保存的重复数据 /*+parallel*/ 优化速度

delete /*+parallel*/  table1  a

where rowid not in(select max(rowid) from table1 b  where a.id=b.id  and a.col=b.col )

--查询非数值类型的数据(数值类型的包括全角数字)1234512345

select * from table1  where not regexp_like(col,'^[[:digit:]]+$')


--查询非数字类型的数据 并且不是数字类型的 (数字类型包含负数 )


select * from table1  where not regexp_like(col,'^[[:digit:]]+$') and not regexp_like(col,'[0-9]')


--mybatis并发插入数据

oracle 下id序列读取 循环保存数据

<insert id="insertJzsbFarmList" parameterType="com.success.zcbf.jzsb.dao.JzsbFarm">
        	 INSERT /*+append*/  INTO JZSB_FARM(ID,YID,COUNTYID,MASTERNAME,REGIONNAME,IDCARD,TOTAL,MEMBERNUM,NATUREVILLAGENAME,NATUREID,FILEPATH,GROUPNAME,REGIONID,APPROVENAME,APPROVETEL,DUTYNAME,DUTYTEL,REASON,ONEFALSE)  
				select  ID.nextval,A* from (
		<foreach collection="list" item="item" index="index" separator="union all">
			<if test="item != null">
			 SELECT	  	 
			 #{item.yid,jdbcType=VARCHAR},#{item.countyId,jdbcType=DECIMAL},#{item.masterName,jdbcType=VARCHAR}, 
			 #{item.regionName,jdbcType=VARCHAR},#{item.idCard,jdbcType=VARCHAR}, 
			 #{item.total,jdbcType=VARCHAR},#{item.memberNum,jdbcType=VARCHAR}, 
			 #{item.natureVillageName,jdbcType=VARCHAR},#{item.natureId,jdbcType=VARCHAR}, 
			 #{item.filePath,jdbcType=VARCHAR},#{item.group,jdbcType=VARCHAR},#{item.regionId,jdbcType=VARCHAR}, 
			 #{item.approveName,jdbcType=VARCHAR},#{item.approveTel,jdbcType=VARCHAR}, 
			 #{item.dutyName,jdbcType=VARCHAR},#{item.dutyTel,jdbcType=VARCHAR},#{item.reason,jdbcType=VARCHAR}, 
			 #{item.oneFalse,jdbcType=VARCHAR}
			   FROM DUAL
			</if>
		</foreach>
			) A
</insert>


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值