select 0 pId,
       t.faccountid,
       t.fcardseqno cardSeqNo,
       t.fmzpatientno mzPNo,
       pin.fname name,
       pin.fsex sex,
       pin.fage age,
       t.flbh lbh,
       t.FREGMODE,
       t.fmzlsh regMzlsh,
       t.fregno regNo,
       t. frq regDate,
       to_date('', 'YYYY-MM-DD') queDate,
       0 queNo,
       0 diffId,
       to_date('', 'YYYY-MM-DD') examTime,
       0 patientType,
       to_date('', 'YYYY-MM-DD') examState,
       t.fkh kh,
       k. fks ks,
       t.ftybh ysh,
       p.fname ys,
       0 dataSouce,
       pin.FTELNUMBER,
       pin.FHOMEPLACE,
       pin.FBIRTHDAY
  from mzsf.treg_main t
  Left Join hisbase.tkssz k
    On t.fkh = k.fkh
  Left Join hisbase.tperson p
    On t.ftybh = p.ftybh
  Left Join mzcard.tpersoninfo pin
    On t.FACCOUNTID = pin.FACCOUNTID
 where t.ftf = 0
   and nvl(t.fistf, 0) = 0
   and t.fmzpatientno = '6204644'
   and to_char(t.frq, 'YYYY-MM-DD hh24:mm:ss') >= '2012-04-26 00:00:00'
 order by t.frq desc同一段脚本、两个数据库的数据一模一样,同样是2008的系统、一个数据库中可以查询出数据,另一个数据库就提示:
java util Date、紧急求助各位英雄好汉、小女子不胜感激~!

解决方案 »

  1.   

    请比较一下:
    select to_char(sysdate,'YYYY-MM-DD hh24:mi:ss'),to_char(sysdate,'YYYY-MM-DD hh24:mm:ss') from dual
    --我这边的结果是:
    TO_CHAR(SYSDATE,'YYYY-MM-DDHH24:MI:SS') TO_CHAR(SYSDATE,'YYYY-MM-DDHH24:MM:SS') 
    --------------------------------------- --------------------------------------- 
    2012-04-26 14:59:46                     2012-04-26 14:04:46                    
      

  2.   

    查询如下:
    SQL> select to_char(sysdate,'YYYY-MM-DD hh24:mi:ss'),to_char(sysdate,'YYYY-MM-DD hh24:mm:ss') from dual;
     
    TO_CHAR(SYSDATE,'YYYY-MM-DDHH2 TO_CHAR(SYSDATE,'YYYY-MM-DDHH2
    ------------------------------ ------------------------------
    2012-04-26 15:24:07            2012-04-26 15:04:07
     
    SQL> 
      

  3.   

    select count(1) as totalrow
       from (select t2.onenum,
       t2.allnum,
       t2.printstatus,
       t.apfd_code,
       t2.gidl_doc_numb,
       t2.orgid,
       t.bdgt_subj,
       t3.subjectcode,
       t3.subjectname,
       case
       when t.acst_id not in
       (887209, 2001, 3001, 4001, 5001, 7001, 8001, 6066768) then
       decode(t2.fund_char,
       '0',
       '预算内',
       '1',
       '其他财政性资金',
       '2',
       '其他',
       '3',
       '预算内(往年)',
       '4',
       '其他财政性资金(往年)',
       '5',
       '其他(往年)')
       else
       '其他'
       end as fund_char,
       t2.pay_amnt,
       t2.dtal_id,
       t2.item,
       t4.name,
       t.gath_org_name,
       t2.smry smry,
       t.acst_id
       from ga_t_apfd_bill t,
       sysmgr_org t1,
       ga_t_apfd_bill_dtal t2,
       busmgr_funnew t3,
       sysmgr_user t4
       where 1 = 1
       and t.gath_org_id = t1.orgid(+)
       and t.bdgt_subj = t3.subjectcode(+)
       and t.apfd_user_id = t4.userid(+)
       and t2.apfd_bill_id = t.apfd_bill_id
       and t.year = 2012
       and t3.year = 2012
       and t.ACST_ID = 1001
       and t.is_Del = 0
       and t.status in ('4', '5')
       and t2.gidl_doc_numb like % '414%'
       order by t1.orgcode, t.bdgt_subj, to_number(t.APFD_CODE))这段哪儿错了??