Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Unexpected query result
Message
From
17/07/2001 09:40:06
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
09/03/2001 11:18:55
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00483532
Message ID:
00531492
Views:
13
Try closing all tables. Sometimes you get unexpected results when tables are open.

Hilmar.

>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 ?
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform