Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT p.id
- FROM posts p,
- comments c,
- users u,
- badges b,
- (SELECT creationdate, MAX(upvotes) AS maxUpVotes FROM users u WHERE u.creationdate > p.creationdate) AS sub1
- (SELECT MAX(relatedpostid) AS maxrelatedpostid FROM postlinks) AS s2
- WHERE c.postid = p.id
- AND u.id = p.owneruserid
- AND c.creationdate = s1.creationdate
- AND u.upvotes = s1.maxUpVotes
- AND s2.maxrelatedpostid > p.id
- AND u.id = b.userid
- AND (b.name LIKE 'Research Assistant');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement