oracle查詢多條條件各不相同的資料

2021-07-09 17:22:01 字數 2256 閱讀 9250

object object = employeeservice.querybysqluniqueresult("select"

+"(select count(*) from pm_overtime where  empid="+employee.getid()+" and overtype=3 "

+" and  overdate>= to_date('"+nf+"-01-01','yyyy-mm-dd')" 

+" and  overdate<=to_date('"+nf+"-03-31','yyyy-mm-dd'))加班一季度,"

+" (select count(*) from pm_overtime where   empid="+employee.getid()+" and overtype=3 "

+ "and  overdate>= to_date('"+nf+"-04-01','yyyy-mm-dd') "

+ "and  overdate<=to_date('"+nf+"-06-30','yyyy-mm-dd')) 加班二季度,"

+"(select count(*) from pm_overtime where    empid="+employee.getid()+" and overtype=3 "

+" and  overdate>= to_date('"+nf+"-07-01','yyyy-mm-dd') "

+" and  overdate<=to_date('"+nf+"-09-30','yyyy-mm-dd')) 加班三季度,"

+" (select count(*) from pm_overtime where    empid="+employee.getid()+" and overtype=3 "

+" and  overdate>= to_date('"+nf+"-10-01','yyyy-mm-dd') "

+" and  overdate<=to_date('"+nf+"-12-30','yyyy-mm-dd')) 加班四季度,"

+"(select count(*) from pm_offwork where    empid="+employee.getid()+" and offtag=3 "

+" and offtxdate>= to_date('"+nf+"-01-01','yyyy-mm-dd') "

+"  and  offtxdate<=to_date('"+nf+"-03-31','yyyy-mm-dd')) 調休第一季度,"

+" (select count(*) from pm_offwork where    empid="+employee.getid()+" and offtag=3 "

+" and offtxdate>= to_date('"+nf+"-04-01','yyyy-mm-dd') "

+" and  offtxdate<=to_date('"+nf+"-06-30','yyyy-mm-dd')) 調休第二季度,"

+"  (select count(*) from pm_offwork where    empid="+employee.getid()+" and offtag=3 "

+"  and offtxdate>= to_date('"+nf+"-07-01','yyyy-mm-dd') "

+" and  offtxdate<=to_date('"+nf+"-09-30','yyyy-mm-dd')) 調休第三季度,"

+" (select count(*) from pm_offwork where    empid="+employee.getid()+" and offtag=3 "

+"  and offtxdate>= to_date('"+nf+"-10-01','yyyy-mm-dd') "

+" and  offtxdate<=to_date('"+nf+"-12-31','yyyy-mm-dd')) 調休第四季度,"

+" (select count(*) from pm_overtime where    empid="+employee.getid()+" and overtype=3 "

+"  and to_char(overdate,'yyyy')='"+nf+"') 加班總數,"

+" (select count(*) from pm_offwork where    empid="+employee.getid()+" and offtag=3 "

+"  and to_char(offtxdate,'yyyy')='"+nf+"') 總數調休"

+" from  dual");

多條件查詢

思路 1.獲取引數值 2.生成查詢條件 3.獲取查詢結果 4.繫結查詢選項 呼叫geturlhtml方法生成查詢url 例如 var y2013 pnvshihufu qbeijing sxuhuiqu 得到url變數值 protected string geturlval string name ...

多條件查詢

多條件查詢時在做專案的時候不可缺少的功能,雖然很簡單,但是自己還是記一下,對自己有用 查詢事件 private void button查詢 click object sender,eventargs e initial catalog uid pwd this.dataserver,this.dat...

多條件查詢

開發工具與關鍵技術 vs c 當使用者需要通過一定的條件進行範圍查詢的時候,在控制器中,就需要判斷使用者傳來的條件,一般使用者條件查詢會有下拉框,文字框等from表單元件 預設下拉框內的資料已繫結,本文暫不進行時間的範圍查詢 通過獲取這些元件的值,可以方便快捷的採集使用者的資訊 一 查詢 創鍵多條件...