简单行转列
来源:互联网 发布:神之浩劫等待游戏数据 编辑:程序博客网 时间:2024/06/05 06:26
with temp as
(select t.TEXT as text from T_TEXT_TESTt)
select temp1.text 类型, count(1) 数量
from (select substr(text,
instr(text, ',', 1, rn) + 1,
instr(text, ',', 1, rn + 1) - instr(text, ',', 1, rn) - 1) text
from (select ',' || t1.text || ',' text, t2.rn
from (select text,
length(text) - length(replace(text, ',', '')) + 1 rn
from temp) t1,
(select rownum rn
from all_objects
where rownum <=
(select max(length(text) -
length(replace(text, ',', '')) + 1) rn
from temp)) t2
where t1.rn >= t2.rn
order by text, rn)) temp1
group by temp1.text
union all
select N'空' as 类型, count(*) as 数量
from T_TEXT_TESTt
where TEXT is null
- 简单行转列
- Oracle的 简单行转列
- Oracle行转列 简单示例
- sql 简单 ---------行转列
- mysql简单行转列
- 数据库行转列简单例子
- 简单
- 简单
- 简单
- 简单
- 简单
- 简单
- 简单
- 简单
- 简单
- 简单
- 简单
- 简单
- POJ 3104 - Drying(二分搜索)
- C++中 explicit的用法
- 二分图判断 (图的搜索)
- android root权限破解分析
- BZOJ 2803 Poi2012 Prefixuffix Hash
- 简单行转列
- HDU2222 Keywords Search
- 【转】Struts2框架提供的结果类型
- 用Matlab的FDAtool生成IIR滤波器参数
- python安装mysqldb
- 模板元编程
- 《Head First 设计模式》之策略模式
- 宏块的分块模式及函数PartitionMotionSearch
- Mongodb操作【转】