日期:2014-05-17 浏览次数:20605 次
update mis_package_syn_log a set a.version = a.version - 1 where not exists select 1 from mis_package_syn_log where code = a.code and orgid = a.orgid and version > a.version
------解决方案--------------------
select code, version, package_id, orgid, id, scrq from mis_package_syn_log where id in (select id, max(version) v from mis_package_syn_log
group by id ) order by id
楼主试试这个语句,看看能用不?前提是ID是唯一的,也就是表主键