次の2つのテーブルがあります
Emp_ID FirstName
------------------------------
1 John
2 Mark
3 Steve
表2:Emp_Transaction
Trans ID Emp_ID start_Date End_date Paid_status Total_Hours Total_Pay
---------------------------------------------------------
1 1 01/07/13 01/14/2013 True 15.00 75.00
2 1 01/15/13 01/21/2013 False 10.00 50.00
3 1 01/21/13 01/27/2013 False 10.00 50.00
4 2 01/07/13 01/14/2013 False 15.00 75.00
5 2 01/15/13 01/21/2013 False 10.00 50.00
6 2 01/21/13 01/27/2013 False 10.00 50.00
7 3 01/07/13 01/14/2013 True 15.00 75.00
8 3 01/15/13 01/21/2013 True 10.00 50.00
9 3 01/21/13 01/27/2013 False 10.00 50.00
結果は次のように出力されます(最も古い未払いの日付)
ID FirstName start_Date End_date Paid_status Total_Hours Total_Pay
--------------------------------------------------------------
1 John 01/15/13 01/21/2013 False 10.00 50.00
2 Mark 01/07/13 01/14/2013 False 15.00 75.00
3 steve 01/21/13 01/27/2013 False 10.00 50.00