Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
以下のような値を持つ列があります
18 ABC 45 XYZ 1 ABC 83 DEF 22 XYZ 4 ABC
Oracle DBから値を取得しながら、以下のようにソートしたい
1 ABC 4 ABC 18 ABC 22 XYZ 45 XYZ 83 DEF
order by を使用するsubstr(column,1)と、期待どおりの結果が得られません4 ABCは22 XYZの後に下がります
substr(column,1)
次のようなことを試しましたORDER BY CAST(substr(column, 2) AS INT)か?
ORDER BY CAST(substr(column, 2) AS INT)