select Field,OtherField from(
select Field,OtherField,a Name from table
where Field<=3
union all
select Field,OtherField,b Name from table
where Field>3 and Field<=6
union all
select Field,OtherField,c Name from table
where Field>6)
group by Name
select Field,OtherField,a Name from table
where Field<=3
union all
select Field,OtherField,b Name from table
where Field>3 and Field<=6
union all
select Field,OtherField,c Name from table
where Field>6)
group by Name
解决方案 »
- 64位 Win7 下 Toad for Oracle 10.5 连接Oracle10g
- Oracle有没有这样一个函数
- 请教各位朋友一sql语句
- pl/sql delete 多条数据时,报 ora-00936?
- 請問在ORACLE的存儲過程中如何使用事務處理﹖
- 一个sqlplus调用参数和设置项的问题
- left join on与带括号的加号的区别
- 按时间分段查询人员所在机构,怎么用sql实现?
- sqlldr命令中,.dis文件与.bad文件有什么不同?被丢弃的记录和被拒绝的记录有什么不一样?不都是没入库的记录吗?
- 如何在PL/SQL块中调用其它用户的对象!
- 关于游标!!
- 如何只查询出日期字段为null的记录?
---------- ----------
1 1
2 1
5 1
4 1
5 1
6 2
8 2
9 2
10 2
6 2
8 2 ID CASE
---------- ----------
9 2
10 2
7 2
decode(sign(field-7),-1,2,
decode(sign(field-11),-1,3,0))) from tablename;最后一个零表示字段值不在[1~10]之间