Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Syntax
Message
From
16/06/2005 10:01:42
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01023915
Message ID:
01023941
Views:
10
>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
>>>
>>>
Previous
Reply
Map
View

Click here to load this message in the networking platform