读书人

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

发布时间: 2014-01-28 21:26:25 作者: rapoo

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
select BH,NM,SUM(PQ) AS PQ,SUM(SLBH) AS SLBHfrom aawhere nm like '%ph%'  GROUP BY BH,NM
------解决方法--------------------------------------------------------
SQL code
select BH,NM,SUM(PQ) AS PQ,SUM(SLBH) AS SLBH from aa where nm like '%ph%'GROUP BY BH,NM

        

读书人网 >oracle

热点推荐