一个简单的数据查询语句,帮帮忙!!
ACCESS数据表有a,b两个字段,我要查找最大b对应的a的值.
select a from table where b=max(b);
提示错误:WHERE 子句 b=max(b)中不能有合计函数.
select a ,max(b) as c from table where b=c;
提示错误:试图执行的查询中不包含作为合计函数一部分的特定表达式'a'。
请问这条sql语句应该怎么写啊?
问题点数:10、回复次数:3Top
1 楼hzhzl()回复于 2005-06-02 18:19:30 得分 5
select a from table where b=(select max(b) from table)
Top
2 楼junjunhao()回复于 2005-06-02 18:21:14 得分 3
select a from table where b=(select max(b) from table).呵呵Top
3 楼fxfeixue(小虾米)回复于 2005-06-02 18:26:36 得分 2
select a from 表名 where b=(select Max(b) from 表名)Top




