select b.ITEM_NAME,b.VALUE,b.UNIT,a.ddd
from (select ITEM_ID,MAX(OnDate) as ddd from 表1 where MZZYH='5' Group By ITEM_ID) a inner join 表2 b
on a.ITEM_ID = 表2.ITEM_ID
这个是对的
select b.ITEM_NAME,b.VALUE,b.UNIT,a.ddd
from (select ITEM_ID,MAX(OnDate) as ddd from 表1 where MZZYH='5' Group By ITEM_ID) a inner join 表2 b
on a.ITEM_ID = 表2.ITEM_ID
这个是对的