我有以下 Order By 我希望以 ROID 顺序输出。相反,输出按 OIDR 顺序显示。为什么 R 会在结尾而不是开头?
select narritive_section as ns, decode(narritive_section,'R','Origin','O','Initial Observation','I','Investigation','D','Disposition') as narritive_section
,person_id, offense_id, entry_date, narritive_text, c_narritive_text
from t_narritive
where not narritive_text is null and offense_id = 11514
order by offense_id, decode(
narritive_section, 'R',1, 'O',2, 'I',3, 'D',4);