Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
UPDATE question
Message
 
 
To
20/08/2009 07:39:51
Lutz Scheffler (Online)
Lutz Scheffler Software Ingenieurbüro
Dresden, Germany
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Environment versions
Visual FoxPro:
VFP 9 SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01419198
Message ID:
01419217
Views:
51
This is the simplest question of all - just use aliases for tables, e.g.

update M set Field1 = Something from (myCur) M
UPDATE T SET n1 = tm.n1m ;
	FROM (lcCur) T inner JOIN ( ;
		SELECT t1.m1, t1.m2, MAX(t1.n1 * t2.f1) AS n1m ;
			FROM (lcCur) t1 inner JOIN Test2 t2 ON t2.Mx = t1.M1 OR t2.Mx = t1.M2 ;
			GROUP BY 1,2 ;
		) tm ON tm.m1 = T.m1 AND tm.m2 = T.m2
>Okay, this one works fine. Thank you.
>
>Now the tricky part
>
>test is not directly availabel
>
>All i now is a var just like
>
>lcCur = 'Test'
>
>
>
>lcCur = 'Test'
>UPDATE (lcCur) SET n1 = tm.n1m ;
>	FROM (lcCur) inner JOIN ( ;
>		SELECT t1.m1, t1.m2, MAX(t1.n1 * t2.f1) AS n1m ;
>			FROM (lcCur) t1 inner JOIN Test2 t2 ON t2.Mx = t1.M1 OR t2.Mx = t1.M2 ;
>			GROUP BY 1,2 ;
>		) tm ON tm.m1 = &lcCur..m1 AND tm.m2 = &lcCur..m2
>
>
>will not work.
>
>Agnes
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