Advertisement
Guest User

Untitled

a guest
Apr 29th, 2017
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 0.62 KB | None | 0 0
  1. select driver, count(*) as number FROM
  2. (
  3. select map, driver, score
  4. from `mapstats_archive_0503201711032017`
  5. where score = (select max(score) from `mapstats_archive_0503201711032017` as f where f.map = `mapstats_archive_0503201711032017`.map and ( map like "NGUI-drift%" or map like "NGUI-speedtrap%"))
  6. UNION ALL
  7. select map, driver, score
  8. from `mapstats_archive_0503201711032017`
  9. where score = (select min(score) from `mapstats_archive_0503201711032017` as f where f.map = `mapstats_archive_0503201711032017`.map and not ( map like "NGUI-drift%" or map like "NGUI-speedtrap%"))
  10.     ) as tab GROUP BY driver ORDER BY number desc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement