求一句查询语句
有张表a
id nane money dj_date
201 鼠标 60 2007-05-06
202 鼠标 62 2007-05-06
203 光驱 150 2007-05-06
204 鼠标 58 2007-05-06
205 光驱 135 2007-05-06
要查询这张表里nane字段里名称不同的最新数据
效果如下:
id nane money dj_date
204 鼠标 58 2007-05-06
205 光驱 135 2007-05-06
[解决办法]
select * from a x
where not exists (
select 1 from a
where nane=x.nane
and dj_date> x.dj_date
)