Having some trouble figuring out how to write the following query:
table1
tbl1.id
tbl1.name
table2
tbl2.id
tbl2.name
table3
tbl3.id
tbl3.quantitysold
tbl3.id1
tbl3.id2
select tbl1.name, tbl2.name, count(tbl3.id), ???count of items in tbl3 that had a quantitysold greater than 10??? from tbl1, tbl2, tbl3 where tbl1.id=tbl3.1d1 and tbltbl2.id=tbl3.id2 group by tbl2.name
So I cannot figure out how-to write the piece between the question marks, or how to get that figure included in my result set. I'd like it to look like:
tbl1.name,tbl2.name, count of table 3 items (tbl3.id), and then the count of items for each name/name that sold more than 10 units
Any ideas?