[RESOLVED] Order By clause (TOP clause)
Hi all,
Its me again with yet another question.
I am using SQLServer 2000 and in a view that I am building I have two SELECT statements joined by a UNION. All the info from both statements appears in one column (as it should), but I want the info from the first SELECT to appear on top (its just one line).
I have an ORDER BY clause in my view but when I try to apply it, SQL tells me that I must specify the TOP clause. :confused:
I have no idea how to accomplish this task.
Can anyone help???
Re: Order By clause (TOP clause)
UNION automatically sorts and distincts the rows in the tables you UNION.
If you want the data to appear in the order of the tables in the UNION you should use UNION ALL.
Re: Order By clause (TOP clause)
Thanks kaffenils,
That did the trick!