Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Join ALL fields from a second table
Message
De
08/05/2011 12:33:56
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01510013
Message ID:
01510014
Vues:
87
This is very simple, it's called a cartesian join, where you join all records in one table with all records in another table. With just one record in table B this is no problem. Be careful though, if both the tables have many records, you may easily run out of resources.
Select tableA.TA_1,tableA.TA_2,tableA.TA_3,tableA.TA_4,tableA.TA_5,tableB.TB_1,tableB.TB_2 from tableA,tableB
If you want to include all the fields from both tables, you may use this syntax
Select * from tableA,TableB
>Is there a Sql select command I can use which ALWAYS joins ALL fields from a second Table onto a main Table
>
>e.g. I have TABLE A with 100 records (Say Fields TA_1, TA_2, TA_3, TA_4, TA_5)
>I have Table B with just one record and say 2 fields (TB_1, TB_2)
>
>I want to end up with All 100 records from Table A, and in each of these Records I want ALL fields from Table B
>So I end up with 100 records with fields (TA_1,TA_2,TA_3,TA_4,TA_5, TB_1, TB_2) where TB_1 and TB_2 will always have same value,
> which will ahve come from Table B
>
>Tia
>Gerard
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform