i have data like this.
Table customer
| customerId | fullName | sex
| 1 | Budi Arsana | Male
| 2 | Peter Parker | Male
and other table name transaction
| Id | bookingDate | customer
| 1 | 2011-09-01 | 1
| 2 | 2011-09-30 | 1
| 3 | 2011-09-01 | 2
And i want get result with combined that 2 table which select the customer who has the transaction then get only 1 transaction with the latest date. Like this
| customerId | fullName | sex | transId | bookingDate
| 1 | Budi Arsana | Male | 2 | 2011-09-30
| 2 | Peter Parker | Male | 3 | 2011-09-01
1 Answer