Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Complicated select via VfpOleDb
Message
From
14/04/2010 17:57:55
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01460193
Message ID:
01460209
Views:
42
>Why not use derived tables instead of intermediate cursors?

That's what I tried first, and it works in VFP proper, but seems to be a bit complicated for the VfpOleDb driver. In metacode, like this:
SELECT distinct {fieldlist from three tables}
	from table1 
	join table2 on {expr1} and {expr2}
	LEFT JOIN table3 cc ON {expr3}
	LEFT JOIN table3 dd on  {expr4}
	LEFT JOIN table3 ee on  {expr5}
	left join (SELECT  {fieldlist2};
			FROM t_table1;
			JOIN table4 ON  {expr6};
			join (select max(datefield) as startdate, etc... group by ....) r2 ;
				on  {expr7};
			join table2  {expr1} and  {expr7};
			WHERE  {expr8};
		union SELECT  {similar except some of the logical expressions are different}) as part2 on {expr9};
        where {expr10}

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform