sql - Compare value of a row with multiple rows in another table -


Suppose I have two table orders that I want to compare to each other.

  order {id int, price money} orders {audited int, icedide int, price money}  

where order.id = order Orridith

Naturally, this is a bad design, because the cost of both tables is not required. However, to find out which rows are worth, how can I prepare a query, which is unmatched with the sum of the prices in the orders?

If I think right:

  SELECT * commands to the left Join orders ordered on.price = ei.price WHERE ei.Price is NULL  

Comments