Posted by Serge Rielau on 03/07/06 23:16
Rick,
I don't get your logic forcing the extra view.
Example:
CREATE TABLE T(c1);
CREATE VIEW V AS SELECT * FROM T ORDER BY c1 ASC;
-- I don't care:
SELECT * FROM V => no order
-- I want "the" order:
SELECT * FROM V ORDER BY ORDER OF V => C1 ASCENDING
Note that the clause is rather brain dead. Your .NET/JDBC/PHP client
could tack it on under the covers if you always want it.
-- I want order and I'm going to decide what it is:
SELECT * FROM V ORDER BY c1 DESC => c1 DESCENDING
The problem with your statement level switch is that it is - eh -
statement level.
That is what if you have a nested view somewhere embedded.
You probably don't want the DBMS to sort unless the order finds it's way
to the top.
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
[Back to original message]
|