Home > Archive > Microsoft SQL Server forum > February 2006 > Order By









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Order By
pkruti@hotmail.com

2006-02-21, 11:23 am

How would i add order by to the syntax below:

"Select * Into ETCLog_holding from etclog where box# BETWEEN " & Box1 &
" and " & Box2

i have tried adding it after Box2 but it doesnt work.

Any ideas?

cedutang@hotmail.com

2006-02-21, 11:23 am

I have tried and its executed ok adding "Order by" after Box2....may be
you shoud to revise "box#" part.

Good luck.

Erland Sommarskog

2006-02-25, 9:44 am

(pkruti@hotmail.com) writes:
> How would i add order by to the syntax below:
>
> "Select * Into ETCLog_holding from etclog where box# BETWEEN " & Box1 &
> " and " & Box2
>
> i have tried adding it after Box2 but it doesnt work.


You can add an ORDER BY clause after Box2, just to be careful to add a
space.

However, it is a fairly pointless thing to do. If you expect data in
ETCLog_holding to have a certain order, you are forgetting the fact
that tables are unordered sets.


--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx
Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com