Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Help Needed Please!
Message
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00548100
Message ID:
00552629
Vues:
24
>>>Perhaps ":)" was a little bit misleading, so I took it as a mockery. Well, let's think about it as a huge misunderstanding.
>
>If that's an apology then it's a pretty sad one.
>
>>> You have an ability to mark post as a help (one star).
>
>Thanks I will do that.
>
>>> Just try my solution again.
>
>I TRIED your solutions 4 or 5 times. I'm done.

Ok, this is a final one, I've just created in order to use orphan divisions and companies without divisions:
local i,k
create table Companies (CompanyNam C(30), cKey N(7))
create table Division (Div_Name C(50), cKey N(7))
for i=1 to 20
  CompanyNam="Company"+transform(i)
  cKey=i  
  insert into Companies from memvar
  for k=1 to 5
      Div_Name="Division"+transform(k)
      insert into Division from memvar
  next  
next
cKey=21
Div_Name="Division Without Parent"
insert into Division from memvar
cKey=22
CompanyNam="Company without Div"
insert into companies from memvar

select min(Div_Name) as Div, cKey from Division group by 2 into cursor curTemp

select iif(Div_Name=Div or isnull(Div_Name), nvl(CompanyNam,padr("Orphan Division",30)), space(30)) as CompanyNam, ;
       nvl(Div_Name,padr("Company without divisions",50)) ;
       from Division ;
       full join Companies on Division.Ckey=Companies.CKey ;
       left join curTemp on Division.cKey=curTemp.cKey and Division.Div_Name=curTemp.Div ;            
      into cursor FinalResult
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform