SAP HANA資料庫裡對中文字串排序的實現

2021-09-12 12:24:11 字數 1589 閱讀 4856

下圖是sap cloud for customer對中文字元的排序結果:

在hana studio上開啟trace:

設定trace file name:

構造測試資料:

drop table test_sort;

create table test_sort ( sid integer,

cname nvarchar(100),

ename nvarchar(20));

insert into test_sort values (1, '山東', 'shandong');

insert into test_sort values (2, '華為', 'huawei');

insert into test_sort values (3, '愛活力', 'aihuoli');

執行select:

select * from test_sort order by cname desc;

找到trace file:

從trace file發現hana是按照中文字元的hexadecimal排序:

所以才會有如下結果:

resultset.columnlabel = [sid:integer, cname:nvarchar, ename:nvarchar] (thread 29569, con-id 300136) at 2017-09-11 15:54:31.140189

resultset.row[1] = [3, u'''\xe7\x88\xb1\xe6\xb4\xbb\xe5\x8a\x9b''', u'''aihuoli'''] (thread 29569, con-id 300136) at 2017-09-11 15:54:31.140204

resultset.row[2] = [1, u'''\xe5\xb1\xb1\xe4\xb8\x9c''', u'''shandong'''] (thread 29569, con-id 300136) at 2017-09-11 15:54:31.140210

resultset.row[3] = [2, u'''\xe5\x8d\x8e\xe4\xb8\xba''', u'''huawei'''] (thread 29569, con-id 300136) at 2017-09-11 15:54:31.140216

愛活力 will be bigger than 山東 and 華為.

SAP HANA資料庫裡對中文字串排序的實現

下圖是sap cloud for customer對中文字元的排序結果 insert into test sort values 1,山東 shandong insert into test sort values 2,華為 huawei insert into test sort values 3...

NBA部署SAP HANA記憶體資料庫

nba是美國的主流運動之一,我們甚至無法將其簡單地歸結為籃球,它更多地承載著一種文化,加上成功的商業運作,nba已經成為乙個全球知名的品牌。在nba成功的背後,當然也少不了it技術的支援。負責nba整體資訊化工作的高階副總裁兼cio michael gliedman向techtarget記者透露,目...

SAP Hana 資料庫程式設計介面 Python

python hana db 驅動 python 終於在 hana 平台上成為一等公民了,可以輕鬆訪問 hana 資料庫。安裝 sap hana client 之後,安裝目錄 hdbclient hdbcli 下面有三個檔案。按照 在python中連線sap hana sap blogs 這篇文章的...