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:
00548235
Views:
15
This message has been marked as the solution to the initial question of the thread.
>Did you add TO_NAME to the orders table? I tried running it using the TASTRADE tables and it gives me the error: SQL: Column 'TO_NAME' is not found.
>
>-regards
I used VFP 7 sample data. Try this
Select Division.ckey, Min(Division.div_name) As div_name ;
	From Division ;
	Group by 1 ;
	Order By 1 ;
	Into Cursor temp1 Nofilter

Select Company.ckey, Padr(Company.companynam, 30) As companynam , ;
	temp1.div_name ;
	From Company, temp1 ;
	Where Company.ckey = temp1.ckey ;
Union All ;	
Select Company.ckey, Space(30), Division.div_name ;
	From Company, Division ;
	Where Company.ckey = Division.ckey ;
		And Not Exists  ( ;
		Select * ;
			From temp1 ;
			Where temp1.ckey = Division.ckey  ;
				And temp1.div_name = Division.div_name ) ;
	Order By 1 ;			
	Into Cursor ResultCursor
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform