There is a table of "Products" of the following structure:
[id, price, price_currency] And about the following content:
[1, 100, RUR] [2, 2, USD] There can be an unlimited amount of currencies, but their quotes are not stored in the database.
Actually the question is how to organize data storage, or work with a similar table so that it is convenient to sort and search using the single currency (for example, USD) as the base currency? In other words, before sampling, you need to somehow bring all prices to a single value in USD currency using an external quote.
There is an idea to supplement the table with the field price_base and store the price in it in the base currency, as well as recalculate this value once a day, but maybe there is a simpler solution?