Inventory with quantities on hand in more than one bin

select a.inv_mast_uid,d.item_id, d.item_desc, a.product_group_id,b.date_last_modified, e.product_group_desc, a.location_id,b.bin, a.qty_on_hand as TotalQtyOnHand, b.quantity as BinQuantityOnHand

from inv_loc as a

inner join inv_bin as b

on a.location_id=b.location_id and a.inv_mast_uid=b.inv_mast_uid

inner join

(select a.location_id, a.inv_mast_uid,b.item_id , count(*) as rowcount2

from inv_bin as a

inner join inv_mast as b

on a.inv_mast_uid=b.inv_mast_uid

where a.quantity<>0

group by a.location_id, a.inv_mast_uid, b.item_id

having count(*)>1) as c

on a.location_id=c.location_id and a.inv_mast_uid=c.inv_mast_uid

inner join inv_mast as d

on a.inv_mast_uid=d.inv_mast_uid

left join product_group as e

on a.product_group_id=e.product_group_id

where b.quantity<>0