抓取最新一组汇率的SQL
日期                     原币别         目标币别      汇率 
 2007/4/1         RMB                  JPY                     5.0 
 2007/4/1         USD                  RMB                     8.0 
 2007/4/1         USD                  JPY                     40.0 
 2007/5/1         RMB                  JPY                     5.1 
 2007/5/1         USD                  RMB                     7.9   
 如何通过SQL语句得到“按原币别,目标币别”聚合后的最新的一组汇率? 
 2007/4/1         USD                  JPY                     40.0 
 2007/5/1         RMB                  JPY                     5.1 
 2007/5/1         USD                  RMB                     7.9 
------解决方案--------------------select * from tb a  
 where not exists 
 (select 1 from tb where 原币别=a.原币别 and 目标币别=a.目标币别 and 日期> a.日期)
------解决方案--------------------select  
     t.*  
 from  
     表 t  
 where  
     not exists(select 1 from 表 where 原币别=t.原币别 and 目标币别=t.目标币别 and 日期> t.日期)