Archives of the TeradataForum
Message Posted: Mon, 28 Jan 2008 @ 13:04:21 GMT
| Subj: || || Re: Sorting of a Select |
| From: || || Victor Sokovin |
| ||Also, do you know of any database platforms that do allow views to be created with an ORDER BY clause? Does SQL Server, Oracle, DB2, etc.
allow this or something?|| |
Oracle accepts ORDER BY in (inline) view definitions and subqueries starting from version 8i but I don't think they guarantee any specific
ordering in the "final" query's result set unless ORDER BY is also specified in that final query as well. The use of these features is tricky and
does not always work well.
SQL Server would refuse ORDER BY in views except if it comes together with TOP N or FOR XML (the latter was added in the 2005 version of the
product) clauses. Again, no guarantee that the final ordering will be respected.
BTW, TOP N and ORDER BY have been added in Teradata in R6 view definitions but I don't think they will help in this thread.