Loading ...
Sorry, an error occurred while loading the content.

ORDER BY

Expand Messages
  • Techie
    I just saw a select  query which returns 20 output column and at the end of the query there was an order by clause (ORDER BY 1,2). In the where condition
    Message 1 of 4 , Aug 1, 2008
    • 0 Attachment
      I just saw a select  query which returns 20 output column and at the end of the query there was an order by clause (ORDER BY 1,2). In the where condition there are about 3 paramaters based on which the result set is filtered. What does the ORDER BY 1,2 denote.




      [Non-text portions of this message have been removed]
    • prema tiwari
      ORDER BY 1,2 denotes the first columns in the SELECT list. The result is sorted based on first column first and then on second column. ... From: Techie
      Message 2 of 4 , Aug 1, 2008
      • 0 Attachment
        ORDER BY 1,2 denotes the first columns in the SELECT list.
        The result is sorted based on first column first and then on second column.

        --- On Fri, 1/8/08, Techie <sqlserver1717@...> wrote:

        From: Techie <sqlserver1717@...>
        Subject: MUGH-SQLCON ORDER BY
        To: sqlcon@yahoogroups.com
        Date: Friday, 1 August, 2008, 1:12 PM






        I just saw a select  query which returns 20 output column and at the end of the query there was an order by clause (ORDER BY 1,2). In the where condition there are about 3 paramaters based on which the result set is filtered. What does the ORDER BY 1,2 denote.

        [Non-text portions of this message have been removed]
















        Connect with friends all over the world. Get Yahoo! India Messenger at http://in.messenger.yahoo.com/?wm=n/

        [Non-text portions of this message have been removed]
      • Shashi Kumar Singh
        Hi, This denote that order by clause will be applied on selected list from the sequence in which order it is written. For Example:- SELECT Col1,Col2,Col3 FROM
        Message 3 of 4 , Aug 4, 2008
        • 0 Attachment
          Hi,

          This denote that order by clause will be applied on selected list from the
          sequence in which order it is written.

          For Example:-

          SELECT Col1,Col2,Col3 FROM Table_T
          ORDER BY 1,2

          Then order by will be on Col1 and Col2


          On 8/1/08, Techie <sqlserver1717@...> wrote:
          >
          > I just saw a select query which returns 20 output column and at the end
          > of the query there was an order by clause (ORDER BY 1,2). In the where
          > condition there are about 3 paramaters based on which the result set is
          > filtered. What does the ORDER BY 1,2 denote.
          >
          > [Non-text portions of this message have been removed]
          >
          >
          >



          --

          Thanks & Regards

          Shashi Kumar Singh
          Senior System Engineer
          IBM India (P)Ltd.
          Email:singh.shashikumar2@... <Email%3Asingh.shashikumar2@...>,
          shashi_120@...


          [Non-text portions of this message have been removed]
        • sunil john
          Dear Tech, You can replace the column name with column number..(ie ORDER BY 1,2 is ORDER BY column1, column) Best Regards Sunil John ... From: Techie
          Message 4 of 4 , Aug 17, 2008
          • 0 Attachment
            Dear Tech,

            You can replace the column name with column number..(ie ORDER BY 1,2 is ORDER BY column1, column)

            Best Regards


            Sunil John



            ----- Original Message ----
            From: Techie <sqlserver1717@...>
            To: sqlcon@yahoogroups.com
            Sent: Friday, August 1, 2008 10:42:13
            Subject: MUGH-SQLCON ORDER BY


            I just saw a select query which returns 20 output column and at the end of the query there was an order by clause (ORDER BY 1,2). In the where condition there are about 3 paramaters based on which the result set is filtered. What does the ORDER BY 1,2 denote.

            [Non-text portions of this message have been removed]



            Send instant messages to your online friends http://uk.messenger.yahoo.com

            [Non-text portions of this message have been removed]
          Your message has been successfully submitted and would be delivered to recipients shortly.