please dont rip this site

ORDER BY Clause

The ORDER BY clause sorts the rows returned in the rowset according to a specified set of criteria.

Syntax

ORDER BY Sort_Column1 [ ASC | DESC ][,Sort_Column2 [ ASC | DESC ] ] ...

Elements

Sort_Column   Specifies the name of the column to be sorted or the ordinal position of the column.
   
ASC | DESC   Specifies the sorting order, either ascending (ASC) or descending (DESC). If you do not specify the sort order, the columns are sorted in ascending order. However, if a column is explicitly marked ascending or descending, succeeding columns will use that same sort order until another column in the list is explicitly marked in the other order.

Example

  1. In the following example:

    • The order of Col1 is ascending (by default).
    • The order of Col2 is descending (explicitly stated).
    • The order of Col3 and Col4 is descending (implicit, same as last keyword).
    • The order of Col5 is ascending (explicitly stated).
    SELECT Col1, Col2, Col3, Col4, Col5
    FROM SCOPE()
    WHERE Col1 > 10
    ORDER BY Col1, Col2 DESC, Col3, Col4, Col5 ASC
  2. The following example is equivalent to the previous example, but refers to the columns by their ordinal position.

    SELECT Col1, Col2, Col3, Col4, Col5
    FROM SCOPE()
    WHERE Col1 > 10
    ORDER BY 1, 2 DESC, 3, 4, 5 ASC

© 1997 by Microsoft Corporation. All rights reserved.


file: /Techref/language/asp/ix/ixseob.htm, 3KB, , updated: 1997/8/15 15:47, local time: 2024/6/28 18:01,
TOP NEW HELP FIND: 
3.147.84.33:LOG IN

 ©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?
Please DO link to this page! Digg it! / MAKE!

<A HREF="http://ecomorder.com/techref/language/asp/ix/ixseob.htm"> SQL Access to Index Server Data: ORDER BY Clause</A>

After you find an appropriate page, you are invited to your to this massmind site! (posts will be visible only to you before review) Just type a nice message (short messages are blocked as spam) in the box and press the Post button. (HTML welcomed, but not the <A tag: Instead, use the link box to link to another page. A tutorial is available Members can login to post directly, become page editors, and be credited for their posts.


Link? Put it here: 
if you want a response, please enter your email address: 
Attn spammers: All posts are reviewed before being made visible to anyone other than the poster.
Did you find what you needed?

 

Welcome to ecomorder.com!

 

Welcome to ecomorder.com!

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  .