I have a table like this:
id transaction_id auto_recurring paid_amount package_customerid
37 0 1 0 4
45 37 1 0 4
51 0 1 0 4
57 51 1 0 4
62 0 1 0 4
67 62 1 0 4
There are 6 records of package_customer_id = 4. Now I want to get the last record of 4. in this case id = 67 is my desired record. I try this SELECT * FROM transactions GROUP BY package_customer_id
. But I got first record of package_customer_id = 4. i.e: id = 4 is my fetched result. How can I get id = 67 (my desired record) modifying this sql?