日期:2014-05-16 浏览次数:20664 次
  select case
         when (not exists
               (select 1
                  from (select t.contract_startdate, t.contract_enddate
                          from pcmscontract t
                         where t.contract_code = 'SHXLFMHG-JM-TX-2011-004') t1
                 where (contract_startdate between
                       to_date('20101201', 'yyyymmdd') and
                       to_date('20110113', 'yyyymmdd') or
                       contract_enddate between
                       to_date('20101201', 'yyyymmdd') and
                       to_date('20110113', 'yyyymmdd') or
                       to_date('20101201', 'yyyymmdd') between
                       contract_startdate and contract_enddate or
                       to_date('20110113', 'yyyymmdd') between
                       contract_startdate and contract_enddate))) then
          1
         else
          0
       end
  from dual