Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Select * from 2 tables
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00307304
Message ID:
00307305
Vues:
21
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform