sql
胡姚超
这个作者很懒,什么都没留下…
展开
-
oracle的关键字大全
nvlnvl2nullifcoalescedecodemerge into v5_tenant_repair_appl_follow fusing (select '2018111219530688462' ra_id,'test' ra_staffcode from dual) non(f.ra_id=n.ra_id)when matched then update set f.ra_staffcode=n.ra_staffcodewhen not matched then.原创 2022-01-15 22:55:11 · 1655 阅读 · 0 评论 -
pageHelper的分页
PagerHelper的分页,看了十几分钟。核心是利用Ibatis的拦截器,进行拦截。拦截后针对不行的sql服务,比如mysql,sqlserver写方言,添加分页机制/* * The MIT License (MIT) * * Copyright (c) 2014-2017 [email protected] * * Permission is hereby granted, free of charge, to any person obtaining a copy * of th原创 2021-09-05 15:06:38 · 162 阅读 · 0 评论 -
sql分组并发查询,java中合并
比如从oracle中查询10万条数据,做业务处理后再更新。查询时可以根据单表的主键做partition,并发读取后,在java中组装。sql:AND MOD(ora_hash(INVENTORY_ID),#{modValue})=#{currentModValue}java:public List<TrInventoryEntity> queryTrInventoryComplex(TrInventoryEntity entity) throws Interrupte.原创 2021-08-14 14:14:05 · 430 阅读 · 0 评论 -
sql索引失效总结
1 like’%param‘索引失效,like’param%‘索引不失效2对索引列进行运算导致索引失效或者函数例如 select * from student where concat('张',name)='张三'3 查询关键字隐式转换导致索引失效例如 select * from student where name=1;name字段为varchar字段,传入参数1为数值4 使用not,!=,<>等函数时例如 selct * from student where ...原创 2021-05-15 23:30:19 · 548 阅读 · 0 评论