ORA-00933:SQL命令未在SQL开发人员中正常运行的查询中正确结束

时间:2021-12-01 23:05:49

Below code gives

下面的代码给出

ORA-00933: SQL command not properly ended

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

on

    private final String DUPLICATE_SQL_1="select abc, count(abc)"
            +"from table_1"
            +"where type= 'NEW'"
            +"and trunc(update_date) = trunc(sysdate)"
            +"group by abc having count(abc)>1";

ResultSet rs = stmt.executeQuery(DUPLICATE_SQL_1);

Same query worked fine on Oracle SQL Developer.

相同的查询在Oracle SQL Developer上运行良好。

1 个解决方案

#1


You are missing spaces (you must have a space at the end of each line except the last or at the start of each line except the first):

您缺少空格(除了第一行之外,每行末尾除了第一行之外或每行的开头都有空格):

private final String DUPLICATE_SQL_1="select abc, count(abc) "
        +"from table_1 "
        +"where type= 'NEW' "
        +"and trunc(update_date) = trunc(sysdate) "
        +"group by abc having count(abc)>1";

#1


You are missing spaces (you must have a space at the end of each line except the last or at the start of each line except the first):

您缺少空格(除了第一行之外,每行末尾除了第一行之外或每行的开头都有空格):

private final String DUPLICATE_SQL_1="select abc, count(abc) "
        +"from table_1 "
        +"where type= 'NEW' "
        +"and trunc(update_date) = trunc(sysdate) "
        +"group by abc having count(abc)>1";