Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Help Needed Please!
Message
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00548100
Message ID:
00548395
Views:
17
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform