A SQL statement is causing issues because one of the tables I join with has duplicate records, which is having the effect of duplicating some of the SUM fields. How do I write an SQL which joins two tables such that only one occurrence of the target table is taken? For example, inventory table is joined with problemtable. Problemtable has 2 records that are duplicated and match the inventory.product. This will result in two records in the result set. How do I only return one row?
sele sum(inventory.qty), problemtable.product
where inventory.product = problemtable.product.