: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
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
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