文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>Firdbird数据库子查询(包含比例)

Firdbird数据库子查询(包含比例)

时间:2010-08-18  来源:08信工实训

 string SJ = DateTime.Now.Year.ToString();
            string str =string.Format(@"select first 1
           (select count(*) from OfficialCaseRegisters where FillTime='{0}') as a,
             (select case (select count(*) from OfficialCaseRegisters where  FillTime='{1}')
            when 0 then 0 else((select count(*) from OfficialCaseRegisters where  FillTime='{2}')*100.0 / count(*))
            end  from OfficialCaseRegisters where  FillTime='{3}') as b,
            (select count(*) from OfficialCaseRegisters  where PostName='正处' and FillTime='{4}') as c,
             (select case (select count(*) from OfficialCaseRegisters where PostName='正处' and FillTime='{5}')
            when 0 then 0 else((select count(*) from OfficialCaseRegisters where  PostName='正处' and FillTime='{6}')*100.0 / count(*))
            end  from OfficialCaseRegisters where  FillTime='{7}') as d,
              (select count(*) from OfficialCaseRegisters  where  PostName='副处' and FillTime='{8}') as e,
             (select case (select count(*) from OfficialCaseRegisters where  PostName='副处' and FillTime='{9}')
            when 0 then 0 else((select count(*) from OfficialCaseRegisters where  PostName='副处' and FillTime='{10}')*100.0 / count(*))
            end  from OfficialCaseRegisters where FillTime='{11}') as f,
            (select count(*) from OfficialCaseRegisters  where  PostName='正科' and  FillTime='{12}') as g,
             (select case (select count(*) from OfficialCaseRegisters where  PostName='正科' and  FillTime='{13}')
            when 0 then 0 else((select count(*) from OfficialCaseRegisters where  PostName='正科' and  FillTime='{14}')*100.0 / count(*))
            end  from OfficialCaseRegisters where  FillTime='{15}') as h,
             (select count(*) from OfficialCaseRegisters  where  PostName='副科' and  FillTime='{16}') as j,
             (select case (select count(*) from OfficialCaseRegisters where  PostName='副科' and  FillTime='{17}')
            when 0 then 0 else((select count(*) from OfficialCaseRegisters where  PostName='副科' and FillTime='{18}')*100.0 / count(*))
            end  from OfficialCaseRegisters where FillTime='{19}') as k,
            (select count(*) from OfficialCaseRegisters  where  PostName='科办员' and FillTime='{20}') as l,
             (select case (select count(*) from OfficialCaseRegisters where  PostName='科办员' and  FillTime='{21}')
            when 0 then 0 else((select count(*) from OfficialCaseRegisters where  PostName='科办员' and  FillTime='{22}')*100.0 / count(*))
            end  from OfficialCaseRegisters where  FillTime='{23}') as z,
             (select count(*) from OfficialCaseRegisters  where  PostName='试用期人员' and  FillTime='{24}') as x,
             (select case (select count(*) from OfficialCaseRegisters where  PostName='试用期人员' and FillTime='{25}')
            when 0 then 0 else((select count(*) from OfficialCaseRegisters where  PostName='试用期人员' and FillTime='{26}')*100.0 / count(*))
            end  from OfficialCaseRegisters where  FillTime='{27}') as v
            from OfficialCaseRegisters ", SJ, SJ, SJ, SJ, SJ, SJ, SJ, SJ, SJ, SJ, SJ, SJ, SJ, SJ, SJ, SJ, SJ, SJ, SJ, SJ, SJ, SJ, SJ, SJ, SJ, SJ, SJ, SJ);

           参数sj表示查询条件。

相关阅读 更多 +
排行榜 更多 +
辰域智控app

辰域智控app

系统工具 下载
网医联盟app

网医联盟app

运动健身 下载
汇丰汇选App

汇丰汇选App

金融理财 下载