选择最近的最近记录 - mysql php

时间:2017-03-05 10:57:01

标签: php mysql

付款架构

installment | remaining balance | date
----------------------------------------
6,000       | 50,000            | 03 March 2017 5:30 PM
10,000      | 40,000            | 04 March 2017 7:00 AM
3,000       | 37,000            | 08 March 2017 3:00 PM

我想选择此行的最后一条记录

3,000       | 37,000            | 08 March 2017 3:00 PM

我怎么能在mysql中实现呢?

1 个答案:

答案 0 :(得分:0)

您可以使用ORDER BYLIMIT,例如:

SELECT *
FROM payment 
ORDER BY date DESC LIMIT 1;