General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
> 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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only