Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
LEFT JOIN and complex criteria
Message
 
 
À
26/09/2006 11:27:09
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01156530
Message ID:
01157271
Vues:
23
>my typo
>
>* try 3 : can to go in error if (cTrans_fk ,iSequence_Number) is not unique and is it slow too ?
>SELECT X.cTrans_pk cTrans_fk;
>  , (SELECT TI.cInsurances_fk FROM Trans_Insurances TI ;
>         WHERE TI.cTrans_fk = X.cTrans_pk AND TI.iSequence_Number = X.iSequence_Number);
>    cInsurances_fk;
>    FROM (select curTemp.cTrans_pk , max(T.iSequence_Number) iSequence_Number;
>    	from curTemp JOIN Trans_Insurances T ON curTemp.cTrans_pk = T.cTrans_fk ;
>	    GROUP BY 1) X ;
>into cursor curTemp1
>
>
>You can uses 2, but it is out of SQL standard,
>5 is not readable,
>4 is better.
>
>UPDATE: ok for the 2. On a more smart backend uses the 1th.

Thanks again. We haven't started testing my new changes, so this may wait a little bit.

BTW, I sent you a PM.
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform