I have a tricky question,
I have two tables,
I want to join the two tables on CustomerNO,I only want to retain all the values of Table1. SO i will use an outer join. But During the join i only want to retrieve the last purchaseID, which will be the greater one. If there a way i can do this. in which i can select the max(PurchaseID) during the join so i only have all the values of the first table and the maximum of the CustomerNO
Lets say
Table1
Name CustomerNo
a 1111
b 1112
c 1113
Table 2
CusomerNO PuchaseID
1111 0999
1112 111
1112 112
I have two tables,
I want to join the two tables on CustomerNO,I only want to retain all the values of Table1. SO i will use an outer join. But During the join i only want to retrieve the last purchaseID, which will be the greater one. If there a way i can do this. in which i can select the max(PurchaseID) during the join so i only have all the values of the first table and the maximum of the CustomerNO
Lets say
Table1
Name CustomerNo
a 1111
b 1112
c 1113
Table 2
CusomerNO PuchaseID
1111 0999
1112 111
1112 112