Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL suggestions needed
Message
De
15/02/2000 16:46:18
Oleg Khvalin
The Sutherland Group Ltd
Rochester, New York, États-Unis
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00331812
Message ID:
00332523
Vues:
23
> 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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform