"select pmbh as 条码号,pm AS 品名,kh as 款号,zsh1 as 证书号,dw as 单位,sl as 数量,weight as 重量,weight1 as 件重,gg AS 规格,szj as 市值价,xsj as 销售价,stoneweight as 主石重,ls as 粒数,B.ys as 颜色,zd as 净度,cg as 切工,xz as 形状,lb as 类别,pp as 商品类型,A.djh as 单据号,A.gysbh as 供应商 from (select pmbh,pm,kh,zsh1,dw,sl,weight,gg,szj,xsj,lb,pp,t_lcd.djh,gysbh,rhch,jsr,rcrq,weight1 from t_lcd inner join t_lclsz on t_lcd.djh=t_lclsz.djh) A left join (select bar,stoneweight,ls,ys,zd,CG,xz from t_stone where sfzs='主石') B on A.pmbh=B.bar where pmbh<>'' and A.rhch='唐山' and pm like '%%' and sl=1 order by pmbh asc"在SQL查询分析器里可以查到记录,而在程序里查询不到记录。"select pmbh as 条码号,pm AS 品名,kh as 款号,zsh1 as 证书号,dw as 单位,sl as 数量,weight as 重量,weight1 as 件重,gg AS 规格,szj as 市值价,xsj as 销售价,stoneweight as 主石重,ls as 粒数,B.ys as 颜色,zd as 净度,cg as 切工,xz as 形状,lb as 类别,pp as 商品类型,A.djh as 单据号,A.gysbh as 供应商 from (select pmbh,pm,kh,zsh1,dw,sl,weight,gg,szj,xsj,lb,pp,t_lcd.djh,gysbh,rhch,jsr,rcrq,weight1 from t_lcd inner join t_lclsz on t_lcd.djh=t_lclsz.djh) A left join (select bar,stoneweight,ls,ys,zd,CG,xz from t_stone where sfzs='主石') B on A.pmbh=B.bar where pmbh<>'' and A.rhch='广东湛江' and pm like '%%' and sl=1 order by pmbh asc"这个在SQL查询分析器和程序里都可以查到记录。(正确)