Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Syntax
Message
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:
01023982
Views:
17
You can't have, because for both records where REPONDANT.IRESIDENTID == 2 LCopy Value is .F.

>Euh ... Ok there is still a problem
>
>I Have'nt resident.iid = 2
>
>
>
> CREATE CURSOR RESIDENT ( iid I )
>
>  CREATE CURSOR REPONDANT ( iid I , IRESIDENTID I , Lcopy L )
>
>  FOR x = 1 TO 6
>    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 , .F.)
>  INSERT INTO REPONDANT ( iid  , IRESIDENTID  , Lcopy  ) VALUES ( 3, 3 , .T.)
>  INSERT INTO REPONDANT( iid  , IRESIDENTID  , Lcopy  ) VALUES ( 4, 5 , .F.)
>  INSERT INTO REPONDANT( iid  , IRESIDENTID  , Lcopy  ) VALUES ( 5, 5 , .T.)
>  INSERT INTO REPONDANT( iid  , IRESIDENTID  , Lcopy  ) VALUES ( 6, 5 , .T.)
>
>
>  SELECT RESIDENT.iid AS 'iresId',;
>    REPONDANT.iid AS 'irepid',;
>    REPONDANT.Lcopy;
>    FROM RESIDENT  LEFT OUTER JOIN REPONDANT ;
>    ON  RESIDENT.iid = REPONDANT.IRESIDENTID;
>    WHERE  REPONDANT.Lcopy IS NULL OR;
>    REPONDANT.Lcopy  ;
>    ORDER BY RESIDENT.iid INTO CURSOR TEMPS
>
>  *   I WANT
>  *   iresid        irepid       lcopy
>  *	1	NuLL		NULL
>  *	2	    2         .F.  && last repondant
>  *   	3              3         .T.
>  *    	4              NULL      NULL
>  *    	5              5          .T.
>  *    	5              6          .T.
>  *      6              NULL      NULL
>
>
>  * I HAVE
>  *	1	    NuLL	     NULL
>  *    	3              3         .T.
>  *    	4              NULL      NULL
>  *    	5              5          .T.
>  *      5               6	      .T.
>  *    	6              NULL       NULL
>
>
>
>
>
>
>
>
>>Hi,
>>
>>It looks like you might have an join problem to me:
>>
>>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 ;
>> ORDER BY Resident.iid
>>
>>you have this as a left outer join-- meaning that we can have as result with non null resident.iid but repondant.id is NULL. This means that repondant.lcopyfact is also null. Meaning that your left join is really identical to a simple inner join!
>>
>>Now I don't know if that is specifically your problem but it is a problem with the query.
>>
>>Hope that helps,
>>Jamie
>>
>>
>>
>>>HI ALL,
>>>
>>>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
>>>
>>>
>>>
>>>thank in advance
>>>
>>>bernhart
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform