在一个sql语句中没有办法实现吧
解决方案 »
- 高分求助:oracle10g 运行一段时间后速度变慢问题
- where 语句的一个判断怎么根据传入的条件生效
- 求数据库导入时,DMP文件很小,但是占据表空间很大的问题,在线等等,急急急!
- oracle存储过程返回值乱码问题
- [求助]这个动态 SQL ,为什么执行不了?
- 我是菜鸟,请问各位大哥们怎样在SQL PLUS 中显示一个表的结构!
- 如何在两个oracle数据库之间进行数据传递啊?
- Oracle “CONNECT BY” 使用(转)
- oracle 如何设置使得用户每次登录都要求必须修改密码?
- 三个表的更改sql怎么写啊
- 对Oracle不是很熟,CREATE TABLE能不能连注释(COMMENTS)一起生成呢?
- 请各位给我看一下这条语句,他老是说我的命令没有正确结束。
sum(...)lb2
...
from
(select count(*) num,lb from table group by lb)
select count(
case 类别 when 'AAA001' then 'a1'
when 'AAA002' then 'a1'
when 'BBB' then 'b1'
when 'CCC' then 'b1'
when 'DDD' then 'd1'
when 'EEE' then 'd1'
else 类别 end) ,
case 类别 when 'AAA001' then 'a1'
when 'AAA002' then 'a1'
when 'BBB' then 'b1'
when 'CCC' then 'b1'
when 'DDD' then 'd1'
when 'EEE' then 'd1'
else 类别 end
from crf_field group by (
case 类别 when 'AAA001' then 'a1'
when 'AAA002' then 'a1'
when 'BBB' then 'b1'
when 'CCC' then 'b1'
when 'DDD' then 'd1'
when 'EEE' then 'd1'
else 类别 end)
FROM后面直接接表名即可。我认为最好做一个对照表,在对照表中
将AAA001和AAA002对应到一个类型中。
然后统计时方便。
from ( select decode ( class, 'AAA002', 'AAA001', 'CCC','BBB',
'EEE','DDD',class) class,count(*) num
from yourtable
group by class
)
group by class