All pastes #763958 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-11-06 21:21 UTC
rendered paste body
Table1:
Bob, x
John, y

Table2:
Bob, 1, 100, 200, 150
Bob, 2, 10, 20, 15
Bob, 3, 10, 20, 1500
Bob, 4, 10, 2000, 15

From the above two tables, what is the easiest way to receive the following table:

Bob, x, 4, 10, 2000, 15

I.e., join Table1 with Table2 such that only one row from Table2 per Table1, and it is sorted by the second column (1,2,3,4)