要根据表中的两个字段来添加一个字段,
比如字段a,字段b,添加字段c
a = 0 并且b = 0 c = 1
a = 0 并且b = 1 c = 2
a = 1 并且b = 1 c = 3求教
比如字段a,字段b,添加字段c
a = 0 并且b = 0 c = 1
a = 0 并且b = 1 c = 2
a = 1 并且b = 1 c = 3求教
解决方案 »
- 关于日期分秒的处理
- 如何UPDATE 多条满足条件的纪录(急!)
- 脚本中一条语句出错,如何在中错地方中止,不要再继续执行?
- 有关复杂select语句分组问题
- 定期运行SQL
- 求Oracle8i下载地址
- 求在9i的存储过程中二维数组的完整例子及说明,在线等.table ,varrry ,recor都行.
- update set (f1,f2) = (select f1, f2 from table2 ) 如何匹配更新?
- 如何在sql*plus下创建用户,表空间和表!再线等待!分不够可以在加!
- 请问oracle中的同义词是何意思?
- 用OCI,NUMBER(10)类型对应C程序用,应该定义什么类型?谢谢
- oracle rollup求解
select case when a =0 and b=0 then 1
when a =0 and b=1 then 2
when a =1 and b=1 then 3
end c from table;
create table t1 (a number(10),b number(10));insert into t1 values (1,1);
insert into t1 values (0,1);
insert into t1 values (0,0); select a,b,
case when a=0 and b=0 then 1
when a=0 and b=1 then 2
when a=1 and b=1 then 3
end c
from t1 a b c
---------------------------
1 1 1 3
2 0 1 2
3 0 0 1
with t as
(select 0 a,0 b from dual
union all
select 0,1 from dual
union all
select 1,1 from dual
)select a,b,a+b+1 c from t;
A B C
---------- ---------- ----------
0 0 1
0 1 2
1 1 3