asp循环去除重复

asp循环去除重复,第1张

sql="select

*

from

dowlond_biao

where

classname

like

'"&ampsearchname&"'"

改成

sql="select

distinct

*

from

dowlond_biao

where

classname

like

'"&searchname&"'"

for

cur

(select

s.id,s.name,s.num,count(1),max(rowid)

max_rowid

from

student

s

group

by

s.id,s.name,s.num

having

count(1)>1)

loop

delete

from

student

where

rowid<>cur.max_rowid

and

id=cur.id

and

name=cur.name

and

num=cur.num

end

loop

for cur (select s.id,s.name,s.num,count(1),max(rowid) max_rowid from student s group by s.id,s.name,s.num having count(1)>1)

loop

delete from student where rowid<>cur.max_rowid and id=cur.id and name=cur.name and num=cur.num

end loop


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/sjk/10063777.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-04
下一篇 2023-05-04

发表评论

登录后才能评论

评论列表(0条)

保存