Have a glance @ http://img98.imageshack.us/img98/4348/tableo.png
For a single country there may be n numbers of country_notes. I Need to fetch all the distinct records of countries with the latest country_note records.
we can get the latest country_notes by using createdt.
I have tries with this query but it is returning redundancy records.
select * from COUNTRYNOTES cn2,COUNTRIES c2 where NoteId IN ( select cn.NoteId from COUNTRYNOTES cn where cn.CreateDt IN (select max(cn1.createDt) from COUNTRY_NOTES cn1 group by cn1.CountryCode)) and cn2.CountryCode=c2.COuntryCode;