Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Unexpected query result
Message
De
09/03/2001 11:18:55
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Unexpected query result
Divers
Thread ID:
00483532
Message ID:
00483532
Vues:
66
Some of this has been posted as an answer to another thread, but I'm posting this as a separate question.

Using VfP6 (no SP yet - waiting for SP5) + Windows 98.

I have two tables, identical structure - different field names, ascending indexes on both fields in each (problem occurs without indexes too).
Table 1 :
fld1a Char 10
fld2a Numeric 5 0
2 records
fld1a   fld2a
ABCD    1
ABC     2

Table 2 :
fld1b Char 10
fld2b Numeric 5 0
2 records
fld1b   fld2b
ABC     1
ABC     2
Can anyone explain why the following queries give different results :

Query 1 :
select * from db1 a, db2 b where (a.fld2a=b.fld2b) AND (trim(a.fld1a)=trim(b.fld2b))
Query 2 :
select * from db1 a, db2 b where (a.fld2a=b.fld2b) AND (trim(a.fld1a)=trim(b.fld2b)) AND (a.fld2a=b.fld2b)
Query 3 :
select * from db1 a, db2 b where (trim(a.fld1a)=trim(b.fld2b)) AND (a.fld2a=b.fld2b)
Query 2 differs from query 1 by duplicating the check for a.fld2a=b.fld2b
Query 3 differs from query 1 by swapping the order of the query.

Am I missing something fundamental ?
Len Speed
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform