should be 3 rows instead of 9, right?
We're going to have to see all the fields in each of the tables to figure out which join criteria are missing.
Basically, it appears that you need to join on more criteria.
e.g. a join b on a.firstfield = b.firstfield and a.AnotherField = b.AnotherField
We just have to figure out which is the "AnotherField" that's needed!
Main Topics
Browse All Topics





by: brejkPosted on 2009-11-04 at 12:43:23ID: 25743678
The rows are not the same. They differ by the values in two columns: b.unitcost as 'Received Unit Cost' and d.unitcost as 'Purchase Unit Cost'. You have to decide which value (for example MIN or MAX) you wish to return in those two columns for each combination of all other columns and then perform grouping by all other columns.