Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combine 2 tables - better way?
Message
From
24/02/2004 12:27:06
 
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00880102
Message ID:
00880356
Views:
28
the problem i had, described in the other message, i fixed by just opening the current table and the history table, prior to running the querry.

i think that the sql got confused, because the 2 tables have the exact same name, they are just in 2 different folders. i think that's why the result came back with 0 records (the history table is empty at this time).

by pre-opening them with different aliases the problem was solved.

Thanks Fred!


>
>SELECT hist.idfld1 FROM history\frames hist ;
>  WHERE SomeCondition ;
>  UNION ALL ;
>  SELECT cur.idfld1 FROM current\frames cur ;
>    WHERE SomeCondition AND cur.idfld1 NOT IN (SELECT idfld1 FROM history\frames WHERE Somecondition) ;
>  INTO CURSOR combined
>
>I think that should work.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform