Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL question
Message
De
06/08/2009 04:38:33
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Database:
Visual FoxPro
Divers
Thread ID:
01416401
Message ID:
01416406
Vues:
70
>>Hi All,
>>
>>I have a SQL problem I have no idea if I can solve it with one select (I can do with two, but this is not what i like to have)
>>
>>The problems comes from an import scenario.
>>
>>I have a table like
>>
>>c1   c2  c3 ...
>>A    a    1
>>A    b    2
>>A    b    3
>>B    c    4
>>B    d    4
>>A    b    3
>>
>>
>>For a given c3 the combination of c1 and c2 should be the same. We can see that for c3=4 this is not true.
>>
>>How do I code a single SELECT SQL that returns just
>>
>>
>>c1   c2  c3
>>B    c    4
>>B    d    4
>>
>>
>>and
>>
>>
>>c3
>>4
>>
>>
>>
>>TIA
>>
>>Agnes
>
>
>
>SELECT *;
>FROM YourTable;
>INNER JOIN YourTable Tbl1 ON YourTable.C3 = Tbl1.C3 AND;
>                             (YourTable.C1 # Tbl1.C1 OR YourTable.C2 # Tbl1.C2);
>INTO CURSOR crsErrors
>BROW NORMAL
>
>NOT TESTED!



Look at the output if you add another combination for B : B e 4
>c1 c2 c3 ...
>A a 1
>A b 2
>A b 3
>B c 4
>B d 4
B e 4
>A b 3
Gregory
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform