What do you mean by not correct? Can you post some code and sample data to
reproduce the problem (including the DDL)?
Do the columns in the ORDER BY list represent a unique key? If not, remember
that ORDER BY can produce different valid orderings if the columns are not
unique. For example, with the following query:
SELECT A, B
FROM Sometable
ORDER BY A
the result:
(1,1)
(1,2)
is just as valid as:
(1,2)
(1,1)
Also, in SQLServer ORDER BY columns reference aliased columns in the SELECT
list but can also reference base table columns which do not appear in the
SELECT list, a feature which can cause some confusion.
--
David Portas
------------
Please reply only to the newsgroup
--