SELECT U.TXTKOD
,U.TXTAD
,F.DBLFIYAT
,F.DBLALISFIYAT
,F.TXTBASLANGICTARIH
,F.LNGKOD
FROM TBLURUN U
INNER JOIN (
SELECT DBLFIYAT
,DBLALISFIYAT
,TXTBASLANGICTARIH
,MAX(LNGKOD) LNGKOD
FROM TBLFIYATVADE
GROUP BY DBLFIYAT
,DBLALISFIYAT
,TXTBASLANGICTARIH
)F ON U.LNGKOD=F.LNGURUNKOD