D salary > 1000 )
女职员的条件倒是符合了,男职员就无法输入了。
实例
代码如下
create table feng_test(id number, val varchar2(20);
insert into feng_test(id,val)values(1,'abcde');
insert into feng_test(id,val)values(2,'abc');
commit;
SQL>select * from feng_test;
id val
-------------------
1 abcde
2 abc
SQL>select id
, case when val like 'a%' then '1'
when val like 'abcd%' then '2'
else '999' www.2cto.com
end case
from feng_test;
id case
---------------------
1 1
2 1
根据我自己的经验我倒觉得在使用case when这个很像
asp case when以在php swicth case开发关语句的用法,只要有点基础知道我觉得在sql中的case when其实也很好理解。
本文来自于壹聚教程网