| Article: |
How to Misuse SQL's FROM Clause | |
| Subject: | Doesn't work for Oracle, Db2 UDB, DB2 or SQLserver | |
| Date: | 2006-03-21 15:55:13 | |
| From: | mm0 | |
|
I assembled sample data from my ssytem to test this out because I didn't believe it was generalizable. It's the opposite of the suggestion for Oracle 8/9 and sqlserver in my test databases, and DB2 and DB2 UDB rewrite the subquery as a join.
|
||
Showing messages 1 through 1 of 1.
-
Doesn't work for Oracle, Db2 UDB, DB2 or SQLserver
2006-03-23 10:46:41 Stéphane Faroult [Reply | View]





There is also an interesting case, which is the one of queries in which the WHERE clause is modified on the fly. It's easy to add a subquery if you have a particular condition that is the existence of given values in a related table. Add a DISTINCT and this table to the FROM clause, all queries for which no screening condition references this table will join it for nothing ...
There is nothing DBMS dependent in all these cases.