2017-12-28 15 views
-2

データベース内のテーブルにステータス列があります。それは30の別個の値を有する。 Status Columnを基準にしてソートしたいのですが、クローズド欠陥が最後に来るはずです。個別の値が変更されることがあります。Oracle SQLソートの問題

+3

関連するテーブル構造とデータを提供してくださいと何が同じHTTPS用試してみました://メタ。 stackoverflow.com/questions/271055/tips-for-asking-a-good-structured-query-language-sql-question/271056 –

答えて

1

ご質問は漠然と 1であるが、しかし、あなたがこのような何かを探しているようだ:

select ... 
    from MyTable 
order by case -- Closed should be in the end 
      when Status = 10 then -- Put the right constant for Closed here 
      1 
      else 
      0 
     end, 
     Status -- if Status is not "Closed", order by Status