select * from (SELECT t1.serialno,t1.partid,replace(replace(t1.filepath,t2.disk,'ftp://'||t2.username||':'||t2.password||'@'||t2.ftpaddress||':'||t2.port ),'\','/') FilePath
      FROM T_AG_RECORDFILE t1 inner join T_AG_RecordfileFTP t2 on substr(t1.filepath,1,2)=t2.disk Where t2.citylist='04')t3 inner join
      (select t.serialno,t.partid,t.acceptbegintime,t.acceptduration,t.accepterno,t.acceptid,t.callerno,t.calleeno,t.usergrade,t.usertype,t.contactbegintime,t.contactendtime,t.callcausedescs from icdmain.t_Pub_Commoninfo  t 
where t.accepterno in ( select t.agentid from icd.tagentinfo t where  t.workgroupid='31')) t4  on  t3.serialno=t4.serialno and t3..partid=t4..partid;

解决方案 »

  1.   

    /* Formatted on 2008/11/27 11:32 (Formatter Plus v4.8.8) */
    SELECT *
      FROM (SELECT t1.serialno, t1.partid,
                   REPLACE (REPLACE (t1.filepath,
                                     t2.disk,
                                        'ftp://'
                                     || t2.username
                                     || ':'
                                     || t2.PASSWORD
                                     || '@'
                                     || t2.ftpaddress
                                     || ':'
                                     || t2.port
                                    ),
                            '\',
                            '/'
                           ) filepath
              FROM t_ag_recordfile t1 INNER JOIN t_ag_recordfileftp t2
                   ON SUBSTR (t1.filepath, 1, 2) = t2.disk
             WHERE t2.citylist = '04') t3
           INNER JOIN
           (SELECT t.serialno, t.partid, t.acceptbegintime, t.acceptduration,
                   t.accepterno, t.acceptid, t.callerno, t.calleeno, t.usergrade,
                   t.usertype, t.contactbegintime, t.contactendtime,
                   t.callcausedescs
              FROM icdmain.t_pub_commoninfo t
             WHERE t.accepterno IN (SELECT t.agentid
                                      FROM icd.tagentinfo t
                                     WHERE t.workgroupid = '31')) t4
           ON t3.serialno = t4.serialno AND t3.partid = t4.partid
           ;
    最后段 t3..partid=t4..partid; 多了两个.