Skip to content

Instantly share code, notes, and snippets.

@evan4
Created July 20, 2021 06:22
Show Gist options
  • Save evan4/7315c52bc8c101eae8b796ffea863a73 to your computer and use it in GitHub Desktop.
Save evan4/7315c52bc8c101eae8b796ffea863a73 to your computer and use it in GitHub Desktop.
best_rates
select r.currency_code, round(min(r.sell),2) as sell,
round(max(r.buy),2) as buy
from rate_ru r
where (r.date_json = CURDATE()) and r.exchanger_id <> r.exchanger_id in (select id
from exchanger_ru e
where (e.centralbank = 0 or e.centralbank is null))
group by r.currency_code order by r.currency_code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment