且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

SAP HANA里的中文排序问题

更新时间:2022-09-12 08:05:56

I have a simple demo, I have create a table which contains 3 rows and they all have a column named"CNAME" to display their Chinese name. And for column ENAME, it displays their Chines name in pinyin.

SAP HANA里的中文排序问题The result in sql trace shows that the Chinese name will be transfer to Hexadecimal character when they are stored in the system and the compare are in fact in these Hexadecimal character:


cursor_140298224832512_c136.execute(’’’ select * from TEST_SORT ORDER BY CNAME desc ‘’’)

SAP HANA里的中文排序问题Therefore, 爱活力 will be bigger than 山东 and 华为.


If you want to sort the Chinese character as you expected, I think the most convenient way is to add a column that display the Chinese name in pinyin and sort in that column.