Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Duplicate results from a unioned Select
Message
 
 
À
01/09/2000 13:48:14
John Tomblin
Service Station Systems, Inc.
San Jose, Californie, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00411880
Message ID:
00412117
Vues:
20
Or if you were trying to get a sum based on numbers from BOTH tables:

select A.Field1, sum(A.Field2 + B.Field2)
from Table1 A ;
join Table2 B on A.Field1 = B.Field1
where A.Field3 <> "XXX"
group by A.Field1



>When I issue a SQL-Select like the following:
>
>select Field1, sum(Field2) from Table;
> where Field3 ! = "XXX";
>union select Field1, sum(Field2) from Table2;
> where Field3 ! = "XXX";
> group by Field1
>
>
>The result table will consistantly contain one record for each Field1 value except for one duplicate.
>
>Does anyone know how to get no duplicates?
Mark McCasland
Midlothian, TX USA
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform