Results 1 to 3 of 3

Thread: Order By

  1. #1
    Join Date
    Mar 2004
    Posts
    50

    Arrow Unanswered: Order By

    Hi,

    Mu query returns six rows with following data :

    COl1 Col2
    ------- ------
    A 10
    B 5
    C 6
    D 9
    E 15
    F 8

    My problem is that I want results to such that the row 'D' comes in the beginning ,and the remaining rows are ordered by Col2.

    COl1 Col2
    ------- ------
    D 9
    E 15
    A 10
    F 8
    C 6
    B 5

    Thanks.

    Ishan

  2. #2
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1

    Re: Order By

    order by decode(col1,'D',1,2), col2;

  3. #3
    Join Date
    Mar 2004
    Posts
    50

    Re: Order By

    Originally posted by andrewst
    order by decode(col1,'D',1,2), col2;
    that was a beautiful solution.

    Thanks

    Ishan

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •