我有一个表格,主要是每个用户的活动记录,我想显示,自上一次活动以来,用户已经花了多少时间。
学历:
SELECT message_log.log_phone_number, message_log.log_updated
FROM message_log
WHERE message_log.log_mode = “inbound”
GROUP BY message_log.log_phone_number
结果
415407XXXX 2012-03-07 13:34:14
434242XXXX 2012-03-07 16:00:42
434465XXXX 2012-03-07 14:49:15
434989XXXX 2012-03-07 15:30:22
757615XXXX 2012-03-07 15:30:54
804651XXXX 2012-03-07 14:13:04
920917XXXX 2012-03-07 15:11:28
Problem: My 结果 is showing the oldest Time Stamp, and I want the most recent. Is there some way to ORDER
within the GROUP BY
?