|
Posted by bozzzza@lycos.co.uk on 09/11/06 10:20
Hi all,
We have a big table connected to a web server, and I want the number of
rows to be limited that get returned.
So I could do something like this:
select top 10 *
from object
order by code
I then realised looking at the help file, because the "order by" clause
is set the SQL Server has to build the complete dataset, do the order
by and then filter it to the first ten rows.
So I was wondering if I put the query into a view like so :
create view vw_object as
select top 10 *
from object
Then ran the query like so:
select *
from vw_object
order by code
would the SQL server just get the top 10 rows from the view first, then
apply other order by on it afterwards?
Navigation:
[Reply to this message]
|