文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
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表示查询条件。

相关阅读 更多 +
排行榜 更多 +
步行僵尸2无限金币版

步行僵尸2无限金币版

体育竞技 下载
狐狸一号特殊任务无限金币版

狐狸一号特殊任务无限金币版

体育竞技 下载
忍者之雷复仇无限金币钻石版

忍者之雷复仇无限金币钻石版

体育竞技 下载