I have two tables which have been combined using an inner join. Table1 Row ID Amount 1 555 567.23 2 555 782.10 3 555 56.00 4 444 3.00 5 444 10.10 Table2 is built using the following query: proc sql; create Table2 as select max(Amount) as Amount from Table1 group on ID ;quit; proc sql; create Table3 as select a.ID, a.Amount from Table1 as a, Table2 as b where a.Amount = b.Amount ;quit; Result in Table3 is ALL of the records in Table1 rather than the two matches. Adding ID to Table2 and then adding ID to the where in Table3 produces the correct results. Why wouldn't the first work since the amounts are unique?
... View more