问下关于一条sql话语,请各位帮下忙

问下关于一条sql语句,请各位帮下忙
列入表:
id,name,date
1 , a  ,2013.05.06
2 , b  ,2013.05.08
3 , c  ,2013.05.05
4 , a  ,2013.07.08

目标:
需要排除重复,根据date获取最新数据。我需要最新的数据
id,name,date
2 , b  ,2013.05.08
3 , c  ,2013.05.05
4 , a  ,2013.07.08


然后我用sql语句无论是用到DISTINCT 还是group by来查询最后都达不到条件
我最后得到的结果都是
id,name,date
1 , a  ,2013.05.06
2 , b  ,2013.05.08
3 , c  ,2013.05.05

求指点~~~~~~

------解决方案--------------------
select id,name,date from 表 as a exist(select id ,name,max(date) from 表 where id = a.id group by name,id having max(date) = a.date)
------解决方案--------------------
引用:
Quote: 引用:

select id,name,date from 表 as a exist(select id ,name,max(date) from 表 where id = a.id group by name,id having max(date) = a.date)

但是之后我怎么拿出他的maxdate呢?

select b.id,b.name,b.date from 表 as a exist(select id ,name,max(date) as date from 表 where id = a.id group by name,id having max(date) = a.date) as b
b.data就是maxdate
------解决方案--------------------
引用:
列入表:
id,name,date
1 , a  ,2013.05.06
2 , b  ,2013.05.08
3 , c  ,2013.05.05
4 , a  ,2013.07.08

目标:
需要排除重复,根据date获取最新数据。我需要最新的数据
id,name,date
2 , b  ,2013.05.08
3 , c  ,2013.05.05
4 , a  ,2013.07.08

求指点~~~~~~


select id,name,"date" from(
select id,name,"date",row_number()over(partition by name order by "date" desc) rn from ax
) where rn=1
order by id;

 
        ID NAME date
---------- ---- ----------
         2 b    2013.05.08
         3 c    2013.05.05
         4 a    2013.07.08