Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Syntax
Message
De
16/06/2005 10:01:42
 
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:
01023941
Vues:
12
>Thank sergey,
>
>a little problem with your code.
>
>
>Try this code...give me a good result.
>
>It 's possible to optimize ?
>
>
>CREATE CURSOR RESIDENT ( iid I )
>
>  CREATE CURSOR REPONDANT ( iid I , IRESIDENTID I , Lcopy L )
>
>  FOR x = 1 TO 10
>    INSERT INTO RESIDENT ( iid  ) VALUES ( x )
>  ENDFOR
>
>  INSERT INTO REPONDANT ( iid  , IRESIDENTID  , Lcopy  ) VALUES ( 1, 2 , .F.)
>  INSERT INTO REPONDANT ( iid  , IRESIDENTID  , Lcopy  ) VALUES ( 2, 2 , .T.)
>  INSERT INTO REPONDANT ( iid  , IRESIDENTID  , Lcopy  ) VALUES ( 3, 3 , .T.)
>  INSERT INTO REPONDANT( iid  , IRESIDENTID  , Lcopy  ) VALUES ( 4, 5 , .F.)
>
  SELECT RESIDENT.iid AS 'iresId',;
    Repondant.iid AS 'irepid';
    FROM RESIDENT  LEFT OUTER JOIN Repondant ;
    ON  RESIDENT.iid = Repondant.IRESIDENTID;
    ORDER BY RESIDENT.iid
>
>BROWSE NOWAIT
>
>  SET
>
>
>
>bernhart
>
>>Try
WHERE  Repondant.lcopyfact OR Repondant.lcopyfact IS NULL ;
There's no need to comapare lcopyfact to .T. because it's a logical value already.
>>
>>>
>>>I have
>>>
>>>resident.dbf
>>>IID I
>>>
>>
>>>repondant.dbf
>>>iid I
>>>iresidentid I
>>>lcopy L
>>>
>>>
>>>I want ALL residents AND all repondants if lcopy = .T.
>>>
>>>This code do'nt function...
>>>
>>>
>>>SELECT Resident.iid AS 'iresId',;
>>> Repondant.iid AS 'irepid';
>>> FROM amline!Resident ;
>>>    LEFT OUTER JOIN amline!Repondant ;
>>>   ON  Resident.iid = Repondant.iresidentid;
>>> WHERE  Repondant.lcopyfact = ( .T. );
>>> ORDER BY Resident.iid
>>>
>>>
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform