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:
00548395
Vues:
15
>Yeah, I should have phrased my question better. I wanted to be able to do it only in SQL code but thought it might be as simple as one SELECT statement (i.e. no unions or second SELECT statements). For some reason I thought it would be a lot easier than the different solutions presented. Go figure!

Kevin,

Here is the best and simplest solution for your problem (hint :):
select min(div_name) as division, cKeyID ;
      from Division group by 1 ;
      order by 2 into cursor curMin nofilter

select iif(div_name==division,CompanyNam,space(30), Div_Name ;
       from Company inner join Division on Company.cKeyID=Division.cKeyID ;
       left join curMin on Division.cKeyID=curMin.cKeyID ;
       and Division.Div_Name=curMin.Division
If it's not broken, fix it until it is.


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

Click here to load this message in the networking platform