case用法很简单,但是平时很少用,由此被问起竟忘了具体语法。
create table t1 (id number);
insert into t1(id) select level from dual connect by level<5;
commit;
select case id
when 1 then
'a'
when 2 then
'b'
else
'c'
end,
id
from t1;
select case
when id = 1 then
'a'
when id = 2 then
'b'
when id between 3 and 4 then
'c'
end,
id
from t1;
drop table t1 purge;
delete 的语法是delete from table 同时delete table也可以。
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/11813230/viewspace-667989/ ,如需转载,请注明出处,否则将追究法律责任。