[Quote=引用 6 楼 zrong 的回复:]
adoquery.SQL.Text :='
select balance,code from table where dates=(select max(dates) from table)'
[/Quote]
select balance,code from table a,(select code,max(dates) dates from table group by code) b where a.code=b.code and a.dates=b.dates'
[Quote=引用 3 楼 zzj850902 的回复:]
应该是 select balance from table where code='xx' order by dates
[/Quote]
select balance from table where code='XX型号' order by dates desc