在oracle10g中可使得排序不區分大小寫
SQL> select * from test order by id;
ID MC
-------------------- ------------------------------------------------------------
A AAAAA
B BBBBB
a aaaaa
b bbbbb
執行計劃
----------------------------------------------------------
Plan hash value: 2007178810
---------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
---------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 4 | 176 | 4 (25)| 00:00:01 |
| 1 | SORT ORDER BY | | 4 | 176 | 4 (25)| 00:00:01 |
| 2 | TABLE ACCESS FULL| TEST | 4 | 176 | 3 (0)| 00:00:01 |
---------------------------------------------------------------------------
Note
-----
- dynamic sampling used for this statement
統計資訊
----------------------------------------------------------
48 recursive calls
0 db block gets
19 consistent gets
0 physical reads
0 redo size
529 bytes sent via SQL*Net to client
385 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
1 sorts (memory)
0 sorts (disk)
4 rows processed
SQL> ALTER SESSION SET NLS_SORT=generic_m_ci;
會話已更改。
SQL> select * from test order by id;
ID MC
-------------------- ------------------------------------------------------------
A AAAAA
a aaaaa
B BBBBB
b bbbbb
執行計劃
----------------------------------------------------------
Plan hash value: 2007178810
---------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
---------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 4 | 176 | 4 (25)| 00:00:01 |
| 1 | SORT ORDER BY | | 4 | 176 | 4 (25)| 00:00:01 |
| 2 | TABLE ACCESS FULL| TEST | 4 | 176 | 3 (0)| 00:00:01 |
---------------------------------------------------------------------------
Note
-----
- dynamic sampling used for this statement
統計資訊
----------------------------------------------------------
4 recursive calls
0 db block gets
15 consistent gets
0 physical reads
0 redo size
529 bytes sent via SQL*Net to client
385 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
1 sorts (memory)
0 sorts (disk)
4 rows processed
如果設定session的環境不方便,以可以設定語句級的排序
程式碼:
SQL> select * from test order by id;
ID MC
-------------------- ------------------------------------------------------------
A AAAAA
B BBBBB
a aaaaa
b bbbbb
SQL> select * from test order by nlssort(id, 'nls_sort=generic_m_ci');
ID MC[@more@]
-------------------- ------------------------------------------------------------
A AAAAA
a aaaaa
B BBBBB
b bbbbb
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/18921899/viewspace-1017479/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- java ArrayList排序不區分大小寫Java排序
- Mysql 的編碼方式使得欄位內容不區分大小寫MySql
- python中不區分大小寫嗎Python
- oracle 不區分大小寫Oracle
- 配置mysql不區分大小寫MySql
- mysql 表明不區分大小寫MySql
- MySQL不區分大小寫設定MySql
- Nginx支援url不區分大小寫Nginx
- vim 查詢不區分大小寫
- 設定MYSQL不區分表大小寫MySql
- 配置CaseInsensitiveMap使key不區分大小寫
- 更改MYSQL資料庫不區分大小寫MySql資料庫
- Git 區分大小寫Git
- Nginx實現url請求不區分大小寫Nginx
- MySQL表名不區分大小寫的設定方法MySql
- 最新版idea不區分大小寫設定Idea
- 密碼區分大小寫密碼
- Git中如何設定區分檔名大小寫Git
- mongodb如何不區分大小寫MongoDB
- MySQL binary 區分大小寫MySql
- MySQL表名區分大小寫MySql
- 查詢區分大小寫 (轉)
- Mysql模糊查詢預設是不區分字母大小寫的MySql
- 設定Oracle的使用者密碼不區分大小寫Oracle密碼
- 使用漢語環境時,grep命令竟然不區分大小寫
- SQL Server 解決不區分中英文大小寫方法SQLServer
- 從字串A中刪除字串B中存在的字母(不區分大小寫)C語言實現字串C語言
- 模糊查詢區分大小寫嗎?
- 短視訊app開發,顯示文字高亮,不區分大小寫APP
- 修改Oracle11g使用者密碼不區分大小寫Oracle密碼
- Sql Server 強制大小寫區分方法SQLServer
- 使MySQL查詢區分大小寫(轉)MySql
- git不區分檔名大小寫這種坑當然要跳出來Git
- MySQL模糊查詢(like)時區分大小寫MySql
- 更改MySql表和欄位區分大小寫MySql
- Oracle靜態監聽中SID_NAME區分大小寫嗎?Oracle
- Java區分大小寫字母數字和符號Java符號
- Oracle 11gR2密碼區分大小寫Oracle密碼