如何查询mysql数据库中部分重复的数据

如何查询mysql数据库中部分重复的数据,第1张

你是要查找数据库中某个字段下的相同数据吧,我给你写2个例子

(数据库执行效率高)

select * from dbo.MediafileInfo as a where

(VideoDownUrl IN (SELECT VideoDownUrl FROM MediafileInfo AS B WHERE A.ProgramID <>B.ProgramID))

(数据库执行效率低)

SELECT *

FROM MediafileInfo AS A

WHERE (SELECT COUNT(*) FROM MediafileInfo WHERE VideoDownUrl=A.VideoDownUrl)>1

select

*

from

credit

where

project_id

=160990

and

PERSON_ID

in

(

select

PERSON_ID

from

(select

PERSON_ID

,

count(1)

from

credit

where

project_id

=160990

group

by

PERSON_ID

having

count(1)>1)

k)


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

原文地址: http://outofmemory.cn/sjk/9257733.html

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

发表评论

登录后才能评论

评论列表(0条)

保存