|
Posted by Gints Plivna on 01/23/08 12:07
On 18 Janv., 00:28, Erland Sommarskog <esq...@sommarskog.se> wrote:
> Gints Plivna (gints.pli...@gmail.com) writes:
> > OK I've also tried it with much bigger table and got the same results
> > as you. Let's hope optimizer will be smart enough to distinguish big
> > work from small work and in case of big work won't do order before
> > top :)
>
> Since you are on SQL 2005, any reason to not use row_number()? Then
> you would have code that would run both on SQL Server and on Oracle?
I'm quite sure row_number won't help me in this case, because I'd like
to limit found number of rows. row_number actually must have order by
clause and ordering before limiting returned number of rows is the
thing I'd like to avoid.
And also this code will run only on SQL Server, so no need for
"portable SQL" (I'm BTW quite sceptical about such "portable SQLs"
generally, because usually it means code will be slow on all
databases :).
Gints
Navigation:
[Reply to this message]
|