Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combine 2 tables - better way?
Message
From
24/02/2004 13:06:03
 
 
To
24/02/2004 12:48:55
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00880102
Message ID:
00880374
Views:
20
hello Fabio

as i mentioned to Fred this won't work, because the sql command will open the history table 1st. since the history and the current table have the same name, when it comes to open the current table it will think it can use an internal 'copy' of the 'other' (history) table.

because of this the resulting cursor does not contain the correct records. i solved this by pre-opening the 2 tables with 2 different alias names and then giving the sql those alias names to work with. therfor the querry does not decide anymore which tables it has to open, since they are already open.

Thanks.


>Hi gunnar,
>
>try this
>
>SELECT hist.idfld1 FROM history\frames hist ;
>WHERE SomeCondition ;
>UNION ;
>SELECT cur.idfld1 FROM current\frames cur ;
>WHERE SomeCondition;
>INTO CURSOR combined
>
>
>Fabio
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform