I think the only change that needs to be made is in the last join condition:
SELECT T1.Org, T1.Dest, T1.Amount, T2.Org, T2.Dest, T2.Amount, T3.Org, T3.Dest, T3.Amount
FROM dbo.RateTable T1 JOIN
dbo.RateTable T2
ON T1.Org = T2.Org JOIN
dbo.RateTable T3
ON T1.Dest = T3.Dest AND T2.Dest = T3.Org
----------------------------------------^
WHERE T1.Amount > (T2.Amount + T3.Amount);
Note that I changed the left outer join
to regular inner joins. The where
condition requires matches.
This is assuming that "Org" standard for "Origin" or something like that.