首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > oracle >

sum中出现then 1 else 0的的含义解决思路

2012-04-16 
sum中出现then 1 else 0的的含义在网上看到一个SQL语句是这样的。select sum(case when fsalary9999 and f

sum中出现then 1 else 0的的含义
在网上看到一个SQL语句是这样的。

select sum(case when fsalary>9999 and fage<35 then 1 else 0 end) from empinfo;


这里的case/end, then 1 else 0 能起到提高查询效率的作用么?为什么。

请大神们指教。

[解决办法]
不能!
可以这样写啊:
select Count(RowID) From empinfo Where fsalary>9999 and fage<35;

热点排行