如何获得最新价格表 (简单问题)
sql   server   2000表:   
 材料               价格                  采购日期 
 A                        2.30                  2007-1-1 
 B                        5.60                  2007-1-1 
 A                        2.35                  2007-1-2 
 B                        5.50                  2007-1-2   
 如何才能得到所有材料的最新价格:   
 材料               价格                  采购日期 
 B                        5.60                  2007-1-1 
 A                        2.35                  2007-1-2
------解决方案--------------------select * from 表 a 
 where 采购日期=(select max(采购日期) from 表 b where a.材料=b.材料)
------解决方案--------------------寫錯了   
 select * from 表 as t 
 where not exists(select 1 from 表 where 材料 = t.材料 and 采购日期 >  t.采购日期)