Advertisement
Guest User

Untitled

a guest
May 28th, 2016
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. SELECT
  2. z_screenshots.guid,
  3. z_screenshots.player_name,
  4. z_screenshots.server,
  5. z_screenshots.map,
  6. z_screenshots.created,
  7. z_screenshots.uploaded,
  8. z_screenshots.uploader_id,
  9. z_screenshots.filesize
  10. FROM z_screenshots
  11. INNER JOIN (
  12. SELECT clients.guid
  13. FROM clients WHERE clients.id NOT IN (
  14. SELECT clients.id
  15. FROM clients
  16. INNER JOIN (
  17. SELECT client_id
  18. FROM penalties
  19. WHERE (penalties.type = 'Ban' AND penalties.inactive = 0)
  20. UNION
  21. SELECT client_id FROM penalties
  22. WHERE (penalties.type = 'TempBan' AND penalties.inactive = 0 AND FROM_UNIXTIME(penalties.time_expire) > NOW())
  23. GROUP BY penalties.client_id
  24. ) penalties
  25. ON clients.id = penalties.client_id
  26. )
  27. ) clients
  28. ON z_screenshots.guid = clients.guid
  29.  
  30. ORDER BY z_screenshots.uploaded DESC;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement