消除sql2000里的重复数据
发布时间:2021-01-12 12:13:55 所属栏目:MySql教程 来源:网络整理
导读:今天PHP站长网 52php.cn把收集自互联网的代码分享给大家,仅供参考。 declare @id1 int,@oldid int,@e_REcordid int,@Olde_REcordid intDECLARE price CURSORFOR SELECT id,E_recordId FROM evaeve order by E_recordId d
以下代码由PHP站长网 52php.cn收集自互联网 现在PHP站长网小编把它分享给大家,仅供参考 declare @id1 int,@oldid int,@e_REcordid int,@Olde_REcordid int DECLARE price CURSOR FOR SELECT id,E_recordId FROM evaeve order by E_recordId desc OPEN price FETCH NEXT FROM price into @oldid,@Olde_REcordid while @@fetch_status = 0 begin FETCH NEXT FROM price into @id1,@e_REcordid if @[email?protected]_REcordid BEGIN delete from evaeve where [email?protected] end set @[email?protected] set @[email?protected]_REcordid end close price DEALLOCATE price delete from evaeve where id not in( select max(id) from evaeve group by E_RecordID) 以上内容由PHP站长网【52php.cn】收集整理供大家参考研究 如果以上内容对您有帮助,欢迎收藏、点赞、推荐、分享。 (编辑:威海站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |