Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT DISTINCT p.* FROM users u, posthistory h, posts p, badges b
- WHERE u.id = h.userid AND h.userid = u.id
- AND h.userdisplayname = u.displayname AND p.id = h.postid
- AND b.userid = u.id
- AND b.name IN ( 'Autobiographer', 'Teacher')
- AND ( SELECT AVG(u2.upvotes) FROM users u2
- WHERE u2.creationdate > p.creationdate)
- >=
- ( SELECT COUNT(*) FROM votes v WHERE v.votetypeid = 3 AND v.postid = h.postid);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement