同一句sql在php里执行没有结果,在navicat里查询有结果是什么原因?
如题,同一句sql在php里执行没有结果,在navicat里查询有结果。
SELECT
TOP 25 SHANGPIN.SPDM,
SHANGPIN.SPMC,
GUIGE1.GGMC AS YS,
SUM (VW_SDLSMX.SL) AS SL,
FJSX3.SXMC AS SHEJI,
FJSX4.SXMC AS DABAN
FROM
SHANGPIN,
GUIGE1,
GUIGE2,
VW_SDLSMX,
FJSX3,
FJSX4
WHERE
VW_SDLSMX.SPDM = SHANGPIN.SPDM
AND VW_SDLSMX.GG1DM = GUIGE1.GGDM
AND VW_SDLSMX.GG2DM = GUIGE2.GGDM
AND VW_SDLSMX.DM1 != '900'
AND VW_SDLSMX.DM1 != '901'
AND SHANGPIN.FJSX3 = FJSX3.SXDM
AND SHANGPIN.FJSX4 = FJSX4.SXDM
AND VW_SDLSMX.SPDM IN (
SELECT
SPDM
FROM
SHANGPIN
WHERE
BYZD4 = '000'
AND BYZD5 = 'eg'
)
GROUP BY
SHANGPIN.SPDM,
SHANGPIN.SPMC,
GUIGE1.GGMC,
FJSX3.SXMC,
FJSX4.SXMC
ORDER BY
SUM (SL) DESC
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
是不是没有 commit
打印出你的sql语句看下,可能传值的时候要加引号。如:变量='$...';
之前也遇到同样的情况,当时把语句复制到window s的记事本,再复制粘贴回回去,居然就好了。