使用group by和order by进行简单访问查询

时间:2017-08-02 07:04:03

标签: vb.net ms-access

我在MS Access上有这样的查询:

select id_number from students_log group by id_number order by log_date

但它给了我这个错误:

You tried to execute a query that does not include the specified expression "log_date"
 as part of aggregate function.

我想知道为什么我无法运行这个简单的查询以及我应该采取哪些解决方法?

1 个答案:

答案 0 :(得分:1)

尝试使用最新的log_date:

select id_number 
from students_log 
group by id_number 
order by max(log_date)