SQL subquery on how to distinguished what has been ordered -


i need list books @ least 4 copies have been ordered bookstore , copies may come multiple orders. not understanding how copies when don't see field close that.

here pic of tables , fields i'm working with.
tables , fields of database

    select t2.title,t3.qty     books t2     join (     select t1.isbn,t1.sum(quantity) qty     orderlines t1     group t1.isbn) t3     on t2.isbn=t3.isbn     t3.qty >= 4 

Comments

Popular posts from this blog

javascript - Thinglink image not visible until browser resize -

firebird - Error "invalid transaction handle (expecting explicit transaction start)" executing script from Delphi -

mongodb - How to keep track of users making Stripe Payments -