Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2005
    Posts
    3

    Unanswered: Oracle: ORDER Options

    Hi,

    i want oracle to sort my query with empty string in a sort field to be listed at the beginning not at the end.

    Are there any options that i can add after "Order by Field" like the parameters DESC for example?

    Thanks for your help.

  2. #2
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    Something like this?
    Code:
    ...ORDER BY DECODE(sort_column, '', '1','2') || sort_column
    assuming sort_column has a character datatype

  3. #3
    Join Date
    Jun 2004
    Location
    Liverpool, NY USA
    Posts
    2,509
    If you want to output the null first then

    select ....
    from ....
    order by sort_column asc nulls first;
    Bill
    You do not need a parachute to skydive. You only need a parachute to skydive twice.

  4. #4
    Join Date
    Sep 2005
    Posts
    3
    great,

    "NULL FIRST"

    thats it!!!

    thanks guys.

Posting Permissions

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