Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Select
Message
De
23/05/2017 13:20:09
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Divers
Thread ID:
01651347
Message ID:
01651355
Vues:
50
>Hi,
>
>I am wondering if possible to make One SQL Select that will get me the desired query.
>
>Example:
>Two tables:
>Table 1:
>
>ID_FIELD     PK_FIELD
>'ABC'            1
>'NBC'            2
>'ABC'            3
>'NBC'            4
>
>
>Table 2
>
>FOREIGN_PK    OTHER FIELDS
>1
>2
>3
>1
>
>
>I want to select records from Table 1 that have FOREIGN_PK matching the Table 1 PK_FIELD or ID_FIELD
>For example, the resulting query for FOREIGN_PK of 1 would be:
>
>
>ID_FIELD      PK_FIELD   FOREIGN_PK
>'ABC'             1                  1
>'ABC'             3                  1
>
>
>The challenge for me is that the ID_FIELD 'ABC' has PK_FIELD 3 which does not match the FOREIGN_PK of 1 but I want to include it in the resulting query.
>
>How would I create a SQL Select for the above task? TIA

I think we need to see more data and more desired results. I don't fully understand what you're looking for here.

Tamar
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform