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:
00548293
Views:
16
>yeah, it says "DIV_NAME is not unique and must be qualified".

My colleague just came up with the simpler and nicer solution, than mine. Here it is:
select CompanyNam as Comp_Name, min(Div_Name) as Div, ;
from Company left join Division ;
on Company.CkeyID=Division.CKeyID ;
group by 1 ;
into cursor curTemp

select iif(Div_Name=Div, Comp_Name, space(30)), Div_Name ;
       from Company left join Division ;
       on Company.CkeyID=Division.CKeyID ;
       left join curTemp on CompanyName+Div_Name=Comp_Name+Div ;
       into cursor FinalResult
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform