:vchno为变量,应换成
select mzghinfo.serialid,mzghinfo.user_id,mzghinfo.sys_time,mzghinfo.stotal,A.stotal,mzghinfo.f_amount,A.f_amount
from mzghinfo,
 (select serialid,user_id,ymd,sum(xmcost) as stotal,sum(f_amount) as f_amount from mzmninfo where vchno='C20030829'  group by serialid,user_id,date) as A
where mzghinfo.serialid=A.serialid and mzghinfo.sys_time=A.ymd and mzghinfo.stotal<>A.stotal

解决方案 »

  1.   

    select mzghinfo.serialid,mzghinfo.user_id,mzghinfo.sys_time,mzghinfo.stotal,A.stotal,mzghinfo.f_amount,A.f_amount
    from mzghinfo,(select serialid,user_id,ymd,sum(xmcost) as stotal,sum(f_amount) as f_amount from mzmninfo where vchno=&vchno group by serialid,user_id,date) as A
    where mzghinfo.serialid=A.serialid and mzghinfo.sys_time=A.ymd and mzghinfo.stotal<>A.stotal
      

  2.   

    as去不去掉也没什么,:vchno--这个在oracle认为是一个占位符,若是参数,请直接写变量名.
      

  3.   

    问题已经解决了,date字段oracle是不认识的.谢谢大家