A
A
Access Denied2016-09-18 21:10:52
MySQL
Access Denied, 2016-09-18 21:10:52

How to bring to a single price + sorting with a condition?

We have two tables, one with entities (price and currency code). The second is the currency code and rate.
How to make a selection from entities with conditions by price (<=, >= and sort from lower to higher and vice versa, having entities with different prices in different currencies?
Thanks in advance for your help.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Kovalsky, 2016-09-19
@AccessDenied80

SELECT e.id,e.name, (e.price*c.quotation) as factPrice from entitys as e
INNER JOIN currencys as c ON c.id = e.curr_id
ORDER BY factPrice

Well, you can try this. It won't work fast.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question