+ -
当前位置:首页 → 问答吧 → 求表中的列数

求表中的列数

时间:2011-08-29

来源:互联网

怎样求表a中每行符合某条件(>0)的列的个数?

作者: coderee   发布时间: 2011-08-29

select case 列1
  when >0 then 1
  else 0
  end +
  case 列2
  when >0 then 1
  else 0
  end
  .....
from table

作者: varick_zhong   发布时间: 2011-08-29

select count(*) where id>100

作者: bdmh   发布时间: 2011-08-29

热门下载

更多