Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL suggestions needed
Message
From
15/02/2000 16:46:18
Oleg Khvalin
The Sutherland Group Ltd
Rochester, New York, United States
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00331812
Message ID:
00332523
Views:
24
> Thanks for your reply. What's the difference in speed between ANSI-style BTW, this is a new term for me) and (?) Normal-style? I noticed, that right join takes lot of time in 'Normal' style.

Nadya,
There is no pre-ANSI outer joins in Fox, but they are still in T-SQL.
That's where I first faced this problem.
When I converted "old" syntax:
SELECT t1.Id,t2.f1 FROM t1,t2 WHERE t1.ID *= t2.KEY AND t2.f2 ="myValue"
to "new" syntax:
SELECT t1.Id,t2.f1 FROM t1 LEFT OUTER JOIN t2 ON t1.ID = t2.KEY WHERE t2.f2 ="myValue"
results were different exactly for same reason your query returned 0 rows.
My real query was not so simple (8 tables, 3 outer joins) and it took me awhile
to find out that in ANSI-92 WHERE restricts result set AFTER join has been performed, but in "old" style WHERE applied BEFORE the join!
So right conversion should be:
SELECT t1.Id,t2.field2 FROM t1 LEFT OUTER JOIN t2 ON t1.ID = t2.KEY
AND t2.f2 ="myValue"
In Fox "old" style exists only for INNER joins, but the rule still apply.

> Another question - is where a way to select only one field from Towns in this syntax? Like Towns.Town as TownName?

Yes, in this sense no difference. You can select fields you want and name them as you wish.
HTH
Oleg
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform