Select b.DISTRICT,b.TEHSIL,b.UID,b.BeneficiaryFullname,b.BeneficiaryRationCardID, b.Gender from ( select BeneficiaryRationCardID, min(DOB) as MaxAge from BPLFamilyDetails where gender='F' group by BeneficiaryRationCardID ) a inner join BPLFamilyDetails b on a.BeneficiaryRationCardID=b.BeneficiaryRationCardID and a.MaxAge=b.DOB inner join ( select x.BeneficiaryRationCardID from BPLFamilyDetails x left join (select BeneficiaryRationCardID from BPLFamilyDetails where UID is null) y on x.BeneficiaryRationCardID=y.BeneficiaryRationCardID where y.BeneficiaryRationCardID iS null group by x.BeneficiaryRationCardID ) c on a.BeneficiaryRationCardID=c.BeneficiaryRationCardID where b.Gender='F'
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)