(数据库执行效率高)
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
对mysql快速批量修改,查重更新
UPDATE mytable
SET myfield = CASE id
WHEN 1 THEN 'value'
WHEN 2 THEN 'value'
WHEN 3 THEN 'value'
END
WHERE id IN (1,2,3)
查重
select t.* from vinstatic t inner JOIN (select vin, count(0) num from vinstatic group by vin) t1 on t.VIN=t1.vin where t1.num>1
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)