Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SELECT-SQL command have different results in VFP8 and VF
Message
 
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
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
01010969
Message ID:
01011009
Vues:
19
Interestingly, if you create a tag on LEFT(ID,4) in the TABB table, it works.

Bad bug... Maybe they tried too hard for more optimization in VFP9 and destroyed some functionality. ;)

--Brad

>
>It looks like VFP9 bug to me. The query #1 should return only 3 records as in VFP8. Notice that field2 in the result is Null instead of blank for the records that shouldn't be included.
>The query #2 correctly returns 3 records.
>
>
CREATE CURSOR taba ( ;
>		ID C(4), ;
>		field1 C(10), ;
>		field2 C(1) ;
>	)
>
>CREATE CURSOR tabb ( ;
>		ID C(6), ;
>		field3 C(1) ;
>	)
>
>INSERT INTO taba VALUES( "0101",  "desc 1", "")
>INSERT INTO taba VALUES( "0201",  "desc 2", "X")
>
>INSERT INTO tabb VALUES( "010101" ,"1")
>INSERT INTO tabb VALUES( "010102" ,"2")
>INSERT INTO tabb VALUES( "010103" ,"3")
>INSERT INTO tabb VALUES( "020101", "1")
>INSERT INTO tabb VALUES( "020102", "2")
>INSERT INTO tabb VALUES( "020103", "3")
>
># 1
>select * from tabb ;
>	LEFT join taba on left(tabb.id,4)=taba.id ;
>		WHERE not empty(taba.field2)
># 2
>select * from tabb ;
>	LEFT join taba on left(tabb.id,4)=taba.id ;
>		WHERE EMPTY(taba.field2)
>
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform