27,581
社区成员
发帖
与我相关
我的任务
分享select * from tb a
where not exists(select 1 from tb where [user_id]=a.[user_id] and abs(datediff(mi,a.vote_time,vota_time))<=60)
and not exists(select 1 from tb where [user_id]=a.[user_id] and convert(varchar(10),vote_time,120)=convert(varchar(10),a.vote_time,120) group by [user_id] having count(*)>3)
and not exists(select 1 from tb where vote_ip=a.vote_ip and convert(varchar(10),vote_time,120)=convert(varchar(10),a.vote_time,120) group by [vote_ip] having count(*)>9)
select * from tb a
where not exists(select 1 from tb where [user_id]=a.[user_id] and abs(datediff(mi,a.vote_time,vota_time))<=60)
and not exists(select 1 from tb where [user_id]=a.[user_id] and convert(varchar(10),vote_time,120)=convert(varchar(10),a.vote_time,120) group by [user_id] having count(*)>3)
and not exists(select 1 from tb where vote_ip=a.vote_ip and convert(varchar(10),vote_time,120)=convert(varchar(10),a.vote_time,120) group by [user_id] having count(*)>9)
select * from tb a
where not exists(select 1 from tb where [user_id]=a.[user_id] and abs(datediff(mi,a.vote_time,vota_time))<=60)
or not exists(select 1 from tb where [user_id]=a.[user_id] and convert(varchar(10),vote_time,120)=convert(varchar(10),a.vote_time,120) group by [user_id] having count(*)>3)
or not exists(select 1 from tb where vote_ip=a.vote_ip and convert(varchar(10),vote_time,120)=convert(varchar(10),a.vote_time,120) group by [user_id] having count(*)>9)