var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: oracle sql query
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?
try using group by and having
select title, author, sum(quantity) as quantity
group by title, author, quantity
having quantity > 20