一列(txn_issue_dt)是char和issue_dt是日期,我試圖比較兩者,但是我自學成功,我很難過,請幫助。查詢中的字符值和日期值比較
SELECT ptf.carrid,
ptf.cov_effdt,
ptf.cvg_id,
ptf.err_msg,
ptf.error_id,
ptf.fine_dt,
ptf.fine_id,
ptf.fine_status,
ptf.polnbr,
ptf.txn_code,
ptf.txn_type,
ptf.rcvd_dt
FROM policy_tracking_fine_view ptf
INNER JOIN canc_rein cr ON cr.polnbr = ptf.polnbr
WHERE ptf.txn_code = '05'
AND ptf.fine_type = 'L'
AND ptf.fine_status_descrip NOT IN ('SUSPENDED', 'VOID')
AND TO_CHAR (ptf.txn_issue_dt, 'yy-mon-dd') = TO_DATE (cr.issue_dt, 'mm/dd/yy');
我收到ORA-01481:無效的數字格式模型 和ORA-01861:文字不匹配格式字符串
嘗試: '和TO_DATE(ptf.txn_issue_dt,'yy-mon-dd')= cr.issue_dt' –