To add to Simon's response, a lot of work has gone into database sorting
algorithms over the years so database sorting is fairly efficient. One of
the advantages the DBMS has over your code is that it may be able to exploit
indexes to facilitate the task.
This isn't to say that you can't sometimes sort faster in code but I would
specify the ORDER BY unless you have critical performance requirements and
your performance testing shows that sorting in your application is the best
method..
--
Hope this helps.
Dan Guzman
SQL Server MVP
"JerryJ" <je****@gmx.de> wrote in message
news:e9**************************@posting.google.c om...
hi there,
I have to fetch values from a database and store them in a vector in
my c++ application.
What is faster? if i fetch the values sorted from the database with a
'order by' clause in the sql-statement or if i fetch them into the
vector unsorted and sort the vector then?
Thanx for your help
Greetz
Jens