sql 数据库实时增量更新


 

---一下sql可以添加到作业中每秒执行一次   数据过多会消耗性能   

 

--数据表如下,其中字段pid mid time price_type是一个组合主键
--pid mid time price price_type uid
insert into 增量更新2( pid, mid, times, price, price_type, uid )
select pid, mid, times, price, price_type, uid
from 增量更新1 t2
where not exists( select 1 from 增量更新2 where pid = t2.pid
and mid = t2.mid and times = t2.times and price_type = t2.price_type )

 

 

 

 

不要看他人高薪,且看闲时谁在拼


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM