Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Is this possible in one or two SQL Select?
Message
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Is this possible in one or two SQL Select?
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01236995
Message ID:
01236995
Vues:
67
I have two tables (simplified):
Child Table. MY_TBL1. Has column MY_VALUE, I
This table has a number of records where MY_VALUE varies.
Example of MY_TBL1:
MY_VALUE
1
2
2
1
3
Parent Table. MY_TBL2. This table have two columns, MY_VALUE, and MY_CAPT, C, 20. This table has all possible values for MY_VALUE that the child table MY_TBL1 can have. For example, MY_TBL2 could have the following rows:
MY_VALUE   MY_CAPT
1          "Caption 1"
2          "Caption 2"
3          "Caption 3"
I want to select records from MY_TBL1 and at the same time create a column for each different value of MY_VALUE. For example, the resulting cursor would have the following rows:
CAPTION_1  CAPTION_2 CAPTION_3
.T.        .F.       .F.
.F.        .T.       .F.
.T.        .T.       .F.
.T.        .F.       .F.
.F.        .F.       .T.
That is, when a row is selected from MY_TBL1 it should set the value of the column (CAPTION_1, 2, or 3) according to the value of the column MY_VALUE.

Is above possible?

Thank you.
"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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform