Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2009
    Posts
    1

    Unanswered: Need help in sql statement for Order by

    Hi All

    I am new to oracle.
    I have data in my table:
    col1
    ----
    AA
    A
    B
    C
    D
    E
    FS
    AA
    A
    B
    C
    D
    E
    FS
    .
    .
    .
    .

    Now when I execute this statement
    SELECT distinct col1 FROM mytable order by col1


    its shows A,AA,B,C,D,E,FS where as I require in the order of AA,A,B,C,D,E,FS

    while I tried with this
    SELECT distinct col1 FROM mytable order by LEN(col1) DESC, col1 ASC



    but i'm getting as AA,FS,A,B,C,D

    Please help me out..

    thanks & regards,

  2. #2
    Join Date
    Nov 2004
    Posts
    1,427
    Provided Answers: 4
    I am new to oracle.
    This is the SQL Server forum. Better repost in the right forum.
    With kind regards . . . . . SQL Server 2000/2005/2012
    Wim

    Grabel's Law: 2 is not equal to 3 -- not even for very large values of 2.
    Pat Phelan's Law: 2 very definitely CAN equal 3 -- in at least two programming languages

  3. #3
    Join Date
    Apr 2007
    Posts
    183

Posting Permissions

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