>>1. >>select min(divnumb) as f ,div.compnumb, ; >>compname from div ; >>join comp on div.compnumb=comp.compnumb ; >>group by div.compnumb into dbf min >>2. >>select iif(min.f=divnumb,min.compname,space(30)) as compnumer, ; >>divnumb, divname ; >>from div left join min ; >>on (min.f=div.divnumb and min.compnumb=div.compnumb)>>
select companynam, div_name ; from company left join division ; on company.cKeyID=division.cKeyID ; into cursor curFinal readwrite select min(div_name) as div_name, companynam ; from curFinal group by 2 ; into cursor curTemp nofilter index on companynam+div_name tag Temp select curFinal set relation to companynam+div_name into curTemp replace companynam with '' for !found('curTemp')Or lots of other variations.