J
john.melbourne
I need a query that joins two tables on three common fields. It needs
to be a LEFT JOIN in that the I need ALL records from the first table
but only matching records from the second. This is not yielded by the
following SQL:
SELECT
tbAUM2.Geography,
tbAUM2.Product, tbAUM2.AssetClass,
tbPropSplit.Asset, [AUM2].[AUM_Value]*[tbPropSplit].[Perc] AS AUM
FROM tbAUM2 LEFT JOIN tbPropSplit
ON (tbAUM2.Geography = tbPropSplit.Geog)
AND (tbAUM2.Product = tbPropSplit.Product)
AND (tbAUM2.AssetClass = tbPropSplit.OrigAsset);
This returns only values of the INNER JOIN. If I drop one of the ON
clauses I get more rows in the result but obviously an incorrect one.
Why am I not getting all the records from tbAUM2?
to be a LEFT JOIN in that the I need ALL records from the first table
but only matching records from the second. This is not yielded by the
following SQL:
SELECT
tbAUM2.Geography,
tbAUM2.Product, tbAUM2.AssetClass,
tbPropSplit.Asset, [AUM2].[AUM_Value]*[tbPropSplit].[Perc] AS AUM
FROM tbAUM2 LEFT JOIN tbPropSplit
ON (tbAUM2.Geography = tbPropSplit.Geog)
AND (tbAUM2.Product = tbPropSplit.Product)
AND (tbAUM2.AssetClass = tbPropSplit.OrigAsset);
This returns only values of the INNER JOIN. If I drop one of the ON
clauses I get more rows in the result but obviously an incorrect one.
Why am I not getting all the records from tbAUM2?