Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2004

    Unanswered: Oracle9i/Group Functions: MAX()

    hi guys,
    here is the question in my assignment:
    List the most expensive book purchased by customer 1017?
    i have these tables: books, customers, orders, orderitems.
    my answer was:
    SELECT MAX(retail) " Most Expensive Book"
    FROM orders NATURAL JOIN orderitems NATURAL JOIN books
    where customer#=1017
    I get the right answer but i can't get both the book title and its price at the same time on the output. i only get this :

    Most Expensive Book

    So, is there any other way to write the SQL code and get something like this:
    Handcranked Computeres

    Most Expensive Book

  2. #2
    Join Date
    Sep 2002
    Provided Answers: 1
    You have done half the job: find the maximum book price.

    Now write a query that uses that (hint: in a subquery) to answer: select the title of the book that has price = the maximum book price.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts