oracle 平常使用总结

来源:互联网 发布:python图像识别 编辑:程序博客网 时间:2024/04/28 23:51

-- 删除重复数据里面前面保存的重复数据 /*+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>


0 0
原创粉丝点击