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

    Unanswered: oracle sql query

    hey guys,
    I want to run the following query

    select title , author , sum(quantity) from
    (select title, author, sum(quantity) from bookdb)
    where sum(quantity) > 20;

    all in all, the query is supposed to go through a database and
    retrieve the quantity of a certain book available, while
    also putting a lowerbound to that quantity.

    for example, i would like to how many different books
    that exist in the database with 20 or more copies available.

    Is there a work around or a simpler way of doing this?

    Many Thanks!

  2. #2
    Join Date
    Dec 2003
    try using group by and having


    select title, author, sum(quantity) as quantity
    from bookdb
    group by title, author, quantity
    having quantity > 20

Posting Permissions

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