Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Select * from 2 tables
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Select * from 2 tables
Miscellaneous
Thread ID:
00307304
Message ID:
00307304
Views:
51
Hi all

I am trying to create a cursor with the content of two tables, the first table contains 425 record, the second one 245. When i issue the following SQL statement : SELECT * from Table1 a, Table 2 INTO CURSOR MyCyrsor i get 104125 records (425*245) !!!

The two tables have the same structure. My workaroud is to create a Temporary table add append from the two tables:

USE Table1
MyCode = 1234
TempTable = SYS(2023)+'\'+SYS(2015)
COPY STRU TO (TempTable)
USE (TempTable) Alias Temp
Append From Table1 For Code = MyCode
Append From Table1 For Code = MyCode

There must be an SQL Statement who can do this ?

Thanks
Next
Reply
Map
View

Click here to load this message in the networking platform