精品偷拍一区二区三区,亚洲精品永久 码,亚洲综合日韩精品欧美国产,亚洲国产日韩a在线亚洲

  • <center id="usuqs"></center>
  • 
    
  • SQL語句case when

    SQL語句case when
    select    trunc(date '2009-01-01','dd') as date_id,          b.org_id as org_id,          b.risk_id as risk_id,          sum(a.planfee-nvl(c.payreffee,0)) ,          (case when to_char(statistic_date-payrefdate>=0) and to_char(statistic_date-payrefdate<90) then sum(a.planfee-nvl(c.payreffee,0))  else '' end),          (case when to_char(statistic_date-payrefdate>=90) and to_char(statistic_date-payrefdate<180) then sum(a.planfee-nvl(c.payreffee,0))  else '' end),          (case when to_char(statistic_date-payrefdate>=180) and to_char(statistic_date-payrefdate<360) then sum(a.planfee-nvl(c.payreffee,0))  else '' end),          (case when to_char(statistic_date-payrefdate>=360) and to_char(statistic_date-payrefdate<720) then sum(a.planfee-nvl(c.payreffee,0))  else '' end),          (case when to_char(statistic_date-payrefdate>=720) then sum(a.planfee-nvl(c.payreffee,0)) else '' end)          from dm_f_prpjplanfee_prop a,dm_policy_prop_cnt b,(select certino,serialno,sum(payreffee) as payreffee from dm_f_prpjpayrefrec_prop where payrefdate<=(date'2009-01-31') group by certino,serialno)  cwhere   a.certino=b.endorse_no  and a.certino=c.certino(+) and a.serialno=c.serialno(+)and     not exists (select 1                   from dm_policy_prop_cnt                  where b.policy_no = policy_no                    and endorse_type_code = '19'                    and certi_type = 'E'                    and statistic_date <= date  '2009-01-31')                    --and b.policy_no='605012008110000000741'                    and b.statistic_date <= date  '2009-01-31' group by trunc(date '2009-01-31','dd'),b.org_id,b.risk_id  這是一個SQL里面的case when語句,如果執(zhí)行這個語句,會提示缺少右括號,但如果把case when語句去掉,就可以執(zhí)行這個語句.
    其他人氣:756 ℃時間:2020-07-03 20:45:49
    優(yōu)質(zhì)解答
    太長了,但是看到一個問題,case when,要求返回的類型必須一直.
    你看你的第一個case when語句
    (case when to_char(statistic_date-payrefdate>=0) and to_char(statistic_date-payrefdate
    我來回答
    類似推薦
    請使用1024x768 IE6.0或更高版本瀏覽器瀏覽本站點,以保證最佳閱讀效果。本頁提供作業(yè)小助手,一起搜作業(yè)以及作業(yè)好幫手最新版!
    版權(quán)所有 CopyRight © 2012-2024 作業(yè)小助手 All Rights Reserved. 手機版