View Single Post
  #2 (permalink)  
Old 05-24-2006, 12:02 AM
alexfr alexfr is offline
Junior Member
 
Join Date: May 2006
Posts: 24
alexfr is on a distinguished road
Default SQL 92 answer. Re: List all customers who ordered products where price of the item is $100 greater than average order?

[sql]SELECT c.id, c.firstname, c.lastname
FROM customers c INNER JOIN orders o ON c.customer_id = c.customer_id
WHERE o.price >
(SELECT AVG(o.price) + 100
FROM orders o)[/sql]
Reply With Quote