Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sql join
Message
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
Divers
Thread ID:
01004490
Message ID:
01004527
Vues:
24
I don't understand, what is change?
There should be no difference how many fields you SELECT to the final result.

BTW how many records you expect according my example? 50 or 70?

>Borislav,
>
>sorry i am mistake.....
>
>*-- On unit les 2 tables ( tp1 et tp2 )
> SELECT NVL( tp2.cnomt , tp1.cnomt ) AS 'cnomt' ,;
> NVL( tp2.cnosecret ,tp2.cnosecret) AS 'cnosecret',;
> NVL( tp2.cparaphe , tp2.cparaphe) AS 'cparaphe',;
> NVL( tp2.iFoncId ,tp2.iFoncId) AS 'iFoncId' , ;
> NVL( tp2.yconso,tp2.yconso) AS 'yconso',;
> NVL( tp2.yconson,tp2.yconson) AS 'yconson',;
> NVL(tp2.netpsPlAs,tp2.netpsPlAs) AS 'netpsPlAs',;
> NVL( tp2.netpsPlNAs, tp2.netpsPlNAs) AS 'netpsPlNAs',;
> NVL( tp2.nextrAss,tp2.nextrAss) AS 'nextrAss' ,;
> NVL( tp2.nextrNass,tp2.nextrNass) AS 'nextrNass' ,;
> NVL( tp2.nOrdreF,tp2.nOrdreF) AS 'nOrdreF',;
> NVL( tp2.cnomf,tp2.cnomf) AS 'cnomf',;
> NVL( tp2.cPauseNo,tp2.cPauseNo) AS 'cPauseNo',;
> NVL( tp2.iemplId,tp2.iemplId) AS 'iemplId',;
> NVL( tp2.D01b ,SPACE(4))AS 'D01b',;
> NVL( tp2.D02b ,SPACE(4))AS 'D02b',;
> NVL( tp2.D03b ,SPACE(4))AS 'D03b',;
> NVL( tp2.D04b ,SPACE(4))AS 'D04b',;
> NVL( tp2.D05b ,SPACE(4))AS 'D05b',;.......
>
>FOR
>
>
>  SELECT NVL( tp2.cnomt , tp1.cnomt ) AS 'cnomt' ,;
>    NVL( tp2.cnosecret ,tp1.cnosecret) AS 'cnosecret',;
>    NVL( tp2.cparaphe , tp1.cparaphe) AS 'cparaphe',;
>    NVL( tp2.iFoncId ,tp1.iFoncId) AS 'iFoncId' , ;
>    NVL( tp2.yconso,tp1.yconso) AS 'yconso',;
>    NVL( tp2.yconson,tp1.yconson) AS 'yconson',;
>    NVL(tp2.netpsPlAs,tp1.netpsPlAs) AS 'netpsPlAs',;
>    NVL( tp2.netpsPlNAs, tp1.netpsPlNAs) AS 'netpsPlNAs',;
>    NVL( tp2.nextrAss,tp1.nextrAss) AS 'nextrAss' ,;
>    NVL( tp2.nextrNass,tp1.nextrNass) AS 'nextrNass' ,;
>    NVL( tp2.nOrdreF,tp1.nOrdreF) AS 'nOrdreF',;
>    NVL( tp2.cnomf,tp1.cnomf) AS 'cnomf',;
>
>
>
>Thank borislav
>
>
>
>
>>Bernhart,
>>What you not like in that SQL?
>>This example returns to me 50 records (as I expect)
>>
>>CREATE CURSOR tp1 ( cnomt C(28) ,;
>>iemplId I,;
>>D01 C(4),;
>>D02 C(4))
>>FOR asd = 1 TO 20
>>    INSERT INTO tp1 VALUES (TRANSFORM(asd), asd, "Do01", "DO02")
>>NEXT
>>
>>
>>CREATE CURSOR tp2 ( cnomt C(28) ,;
>>iemplId I,;
>>D01b C(4),;
>>D02b C(4))
>>FOR asd = 1 TO 50
>>    INSERT INTO tp2 VALUES (TRANSFORM(asd), asd, "Do01b", "DO02b")
>>NEXT
>>
>>SELECT NVL( tp2.cnomt , tp1.cnomt ) AS 'cnomt',;
>>NVL( tp2.iemplId,tp2.iemplId) AS 'iemplId',;
>>NVL( tp2.D01b ,SPACE(4))AS 'D01b',;
>>NVL( tp2.D02b ,SPACE(4))AS 'D02b',;
>>NVL( tp1.D01 ,SPACE(4))AS 'D01',;
>>NVL( tp1.D02 ,SPACE(4))AS 'D02';
>>FROM tp2;
>>FULL JOIN tp1 ON tp2.iemplId = tp1.iemplId INTO CURSOR Tp
>>BROW
>>
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform