表的字段为 AA, BB 。4条记录为 1 ee,2 aa, 3 cc ,3 dd,我要写一条SQL语句找出 AA最大的记录怎么写?

如题所述

字段AA的数据类型是整形吗,不是的话可以转换成整形判断

select * from 表 

where CONVERT(INT,AA)=(select MAX(CONVERT(INT,AA)) from 表) 

温馨提示:答案为网友推荐,仅供参考
第1个回答  2012-09-16
select * from table where aa =(select max(aa) from table )
相似回答