ORACLE可以借助DECODE函数,自定义顺序排序: select * from ( select 'Nick' as item from dual union all select 'Viki' as item from dual union all select 'Glen' as item from dual union all select 'Robin' as item from dual union all select 'Total' as item from dual ) pr…
ORACLE可以借助DECODE函数,自定义顺序排序: select * from ( select 'Nick' as item from dual union all select 'Viki' as item from dual union all select 'Glen' as item from dual union all select 'Robin' as item from dual union all select 'Total' as item from dual ) pr…
#引言 有一个集合,对其进行排序,排序规则为:按对象中某个字段的特定顺序进行排序,比如:对象属性id,按照[4,2,5,1]的顺序排序: #代码: public class Foo { public int Id { get; set; } public string Name { get; set; } } 1.demo1:按字段id进行自定义排序 List<Foo> foos = new List<Foo> { , Name = , Name = "a" }…