oracle之常用语句
1.查询用户数据所占空间:select sum(bytes)/1024/1024 from user_extents;
2.按字段的首字母进行查询
select * from table order by NLSSORT(SUBSTR(col,1,1))
顺便普及下nlssort的用法
nlssort是在9i中才加入的特性 三句话说明nlssort的用法
--按拼音查询 SELECT * FROM table ORDER BY NLSSORT(col,'NLS_SORT = SCHINESE_PINYIN_M') --按拼音笔划 SELECT * FROM table ORDER BY NLSSORT(col,'NLS_SORT = SCHINESE_STROKE_M') --按拼音部首 SELECT * FROM table ORDER BY NLSSORT(col,'NLS_SORT = SCHINESE_RADICAL_M')