【发布时间】:2014-08-18 09:06:08
【问题描述】:
我在 SO 上看到了一些类似类型的问题,但是,我无法找到针对我的具体问题的解决方案。我想获取最近的时间戳并在 PHP 代码中调用它。 (仅供参考,这些不是我真正的专栏,只是一个简短的例子)。
my_table
row_1 row_2 TimeStamp
======================================================
01 04 2014-06-24 22:00:00
02 01 2014-06-25 19:00:00
03 93 2014-06-27 14:00:00
04 83 2014-06-27 14:31:20 <=== I would like to return this row (latest time)
所以,我想做的是能够:
1) Select the "newest" row, based on timestamp AND
2) Select the 'row_2' column accordingly to the timestamp
在这方面的任何帮助都会很棒。
感谢高级!
【问题讨论】:
-
你使用什么数据库?
-
我正在使用Mysql数据库..
-
@MarkM 是的.. 我刚刚编辑过。