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

You should use this:

SELECT [fieldlist] FROM TABLE A ;
UNION ;
SELECT [fieldlist] FROM TABLE B

Make sure both fieldlists are compatible, because the union clause can only be used this way. Look in the VFP Help for more info about the UNION clause in a SQL - Select.

Regards,
Frank Camp

>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
Frank Camp
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform