SELECT  rtrim(b.djbh)+rtrim(b.rq)+rtrim(a.spbh)+rtrim(b.pihao)+rtrim(b.chkshl) as billno,   'XXX有限公司' as CompID, b.rq       AS SalesTime, c.dwbh     AS CustomerID, c.dwmch    AS Customer, a.spbh     AS ProdID, a.spmch    AS Prod, a.shpgg    AS Spec,      '' as package, a.shpchd   as manufacturer, a.dw       AS Unit, b.pihao    AS BatchNo, b.chkshl   AS SalesAmount, b.chbdj*1.17    as SalesPrice, '' ecode  FROM  spkfk a,splsk b,mchk c WHERE  b.dwbh=c.dwbh  and b.spid=a.spid and djbh like 'XS[A,C]%'  and ( (a.spmch like '%肠炎宁片%' and a.shpchd like '%天施康%') or (a.spmch like '%伤湿止痛膏%' and a.shpchd like '%康恩贝%') or (a.spmch like '%麝香壮骨膏%' and a.shpchd like '%康恩贝%') or (a.spmch like '%复方氨酚烷%' and a.shpchd like '%佐力%') or (a.spmch like '%复方鱼腥草%' and a.shpchd like '%康恩贝%')  or (a.spmch like '%奥美拉唑%' and a.shpchd like '%康恩贝%'))  AND b.chkshl<>0