找出某个型号对应最高版本
---------找出某个型号对应最高版本-----------
SELECT distinct *
into #temp1
FROM [fp_db].[dbo].[mktxhglb]
where substring(pdctno,2,4) = 'ABWQ'
select distinct *
into #temp2
from #temp1 a
where not exists (select * from #temp1 where substring(PdctNo,1,8)=substring(a.PdctNo,1,8) and PdctNo>a.PdctNo)
select pdctno from #temp2