Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Select
Message
 
 
À
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:
01651358
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

You are right. I need to create a better illustration of what am trying to do. Will do and post it then.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform