当前位置: 代码迷 >> SQL >> ORA-00933:SQL下令未正确结束
  详细解决方案

ORA-00933:SQL下令未正确结束

热度:145   发布时间:2016-05-05 12:46:55.0
ORA-00933:SQL命令未正确结束
点击右边红色标题查看本文完整版:ORA-00933:SQL命令未正确结束

GROUP BY 在SQL Worksheek中运行出错,

select *
from aa
where nm like '%ph%'? 可以正常运行显示

但用

select BH,NM,SUM(PQ) AS PQ,SUM(SLBH) AS SLBH
from aa
GROUP BY BH,NM
where nm like '%ph%'? 提示ORA-00933:SQL命令未正确结束,我的语句有问题还是ORACLE有别于SQL SERVER 2000的语法格式



------解决方法--------------------

SQL code
<!--Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->select BH,NM,SUM(PQ) AS PQ,SUM(SLBH) AS SLBHfrom aawhere nm like '%ph%'  GROUP BY BH,NM
------解决方法--------------------
SQL code
<!--Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->select BH,NM,SUM(PQ) AS PQ,SUM(SLBH) AS SLBH from aa where nm like '%ph%'GROUP BY BH,NM