Guest User

Untitled

a guest
Nov 19th, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1. SELECT A.login, count(DISTINCT L.country)
  2. FROM Locations L, Authors A, Reads R, Books B
  3. WHERE L.ip = R.ip and R.bid = B.bid and A.aid = B.aid
  4. GROUP BY A.login
  5. HAVING count(DISTINCT L.country) >= 4
  6. ORDER BY A.login, count(L.country) DESC
Add Comment
Please, Sign In to add comment