1. We have moved to a new forum! There may be a few things not working properly so please let us know if you find a bug. Remember to use the bbCode [ sql ] tag for SQL statements.

List all customers who ordered products where price of the item is $100 greater than average order?

Discussion in 'SQL - Questions and Answers' started by alexfr, May 24, 2006.

  1. alexfr New Member

    Dialect: MySQL
    List all customers who ordered products where price of the item is $100 greater than the average price orders
  2. alexfr New Member

    Dialect: SQL 92
    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)

Share This Page