C# Oracle SQL排序问题
我们在数据库的一个表中有status列。它有30个不同的值。我想在状态栏的基础上对其进行排序,记住关闭的缺陷应该在最后出现。不同的值可能会发生变化。您的问题是模糊的,但是,您似乎在寻找这样的问题:C# Oracle SQL排序问题,c#,sql,C#,Sql,我们在数据库的一个表中有status列。它有30个不同的值。我想在状态栏的基础上对其进行排序,记住关闭的缺陷应该在最后出现。不同的值可能会发生变化。您的问题是模糊的,但是,您似乎在寻找这样的问题: select ... from MyTable order by case -- Closed should be in the end when Status = 10 then -- Put the right constant for Closed here
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
请提供相关的表格结构和数据,以及您尝试的相同内容