Below is the query
It returnes the amount of products, the serial no and quanity
what i need to display in the results is alias column 'qty' only to display items
greater than 0
select name
, serialno
, sum(saleslead_product.quantity) as qty
from company
inner join saleslead on company.id = saleslead.company_id
inner join saleslead_product on saleslead.id = saleslead_product.saleslead_id
inner join product on saleslead_product.product_id = product.id
where name like 'test'
group by name
, serialno
thanks.... been staring at the screen to long!!
No comments:
Post a Comment