Advertisement
kieni17

Untitled

Apr 4th, 2020
442
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PL/SQL 0.32 KB | None | 0 0
  1. SELECT p.id FROM posts p, comments c, users u, badges b
  2. WHERE c.postid = p.id
  3.     AND u.id = p.owneruserid AND u.id = b.userid
  4.     AND u.upvotes IN (SELECT MAX(upvotes) FROM users u WHERE u.creationdate > p.creationdate)
  5.     AND EXISTS (SELECT 1 FROM postlinks l WHERE l.relatedpostid > p.id)
  6.     AND (b.name LIKE 'Research Assistant');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement