select distinct (pc.id,pc.PolicyPremiumID) ,pc.policyPremiumCatID,b.nin, b.firstname+' '+coalesce((b.middleInitial),'')+' '+b.lastname as fullname, b.gender,ppc.amount from bio_data b, medicalInsurance m, policy p, policyPremium pp,premiumCategories pc,policyPremiumCategory ppc where b.nin=m.patientBin and m.policyID=p.id and (p.id=pp.policyID and pp.policyID=p.id) and pp.id=pc.policyPremiumID and pc.policyPremiumcatID=ppc.id and p.id=82
in the above query, I want to have a distinct of those two columns it is duplicating instead of 7 return values it bring 14 Can some please help? Thanks in advance!!!