Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Syntax
Message
De
17/06/2005 05:52:51
 
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:
01023915
Message ID:
01024231
Vues:
22
>Sergey,
>
>Thank for your Help.
>
>This is a difficult query !
>
>I try this code this night and it seems to function...
>
>
>
>*-- WARNING
>SET ENGINE BEHAVIOR 70 && Because The clause 'DISTINCT' is not allowed...
>
> SELECT DISTINCT   Rep.iid AS 'irep',;
>      Rep.lcopyfact,;
>      R.iid AS 'ires',;
>      ve.cnofact,;
>      ve.iid,;
>      ve.gcommentfamille AS 'memoFam';
>      FROM amline!cFiltre cf;
>      INNER JOIN amline!Vente ve ON  cf.ichoixId = ve.iid ;
>      INNER JOIN amline!RESIDENT R ON  ve.itelephoneid = R.itelephoneid;
>      INNER JOIN amline!Archfact   ON  ve.iid = Archfact.iventeid ;
>      LEFT JOIN amline!REPONDANT Rep ON  R.iid = Rep.IRESIDENTID AND Rep.lcopyfact= .T. ;
>      ORDER BY Rep.iid WHERE cf.lactif = .T.  AND cf.ireport = 92 INTO CURSOR TempCrystal
>
>
>
>IF I Want SET ENGINE BEHAVIOR 90 What must I modify?
>
>Thank For your Help
>
>bernhart
* ve.iid is a pk ?
* WHY you use = .T. ??
* WHY you use fieldname expression ?
* don't put ORDER BY before WHERE
SELECT tDistinct.*;
, ve.gcommentfamille AS memoFam;
, ve.cnofact;
FROM FORCE (SELECT DISTINCT Rep.iid AS irep;
      , Rep.lcopyfact;
      , R.iid AS ires;
      , ve.iid;
      FROM amline!cFiltre cf;
      INNER JOIN amline!Vente ve ON  cf.ichoixId = ve.iid ;
      INNER JOIN amline!RESIDENT R ON  ve.itelephoneid = R.itelephoneid;
      INNER JOIN amline!Archfact   ON  ve.iid = Archfact.iventeid ;
      LEFT JOIN amline!REPONDANT Rep ON  R.iid = Rep.IRESIDENTID AND Rep.lcopyfact ;
      WHERE cf.lactif  AND cf.ireport = 92) tDistinct;
      INNER JOIN amline!Vente ve ON  tDistinct.iid = ve.iid ;
ORDER BY irep ;
 INTO CURSOR TempCrystal
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform