ORA-00936: missing expression oracle

断了今生、忘了曾经 提交于 2019-11-28 14:21:35

Your query can be much simplified. It has things like extra layers of subqueries and an unnecessary order by in an in subquery. What you want to do with rownumber you can do with just rownum:

SELECT DAL_ROWNOTABLE.DAL_ID
FROM (SELECT ticket.id AS "DAL_ID" 
      FROM ticket_table ticket 
      WHERE (ticket.type = N'I' ) AND 
            (ticket.tenant IS NULL OR
             ticket.tenant IN (SELECT tgm.tenant_id 
                               FROM tenant_group_member tgm
                               WHERE tgm.tenant_group = HEXTORAW('30B0716FEB5F4E4BB82A7B7AA3A1A42C') 
                              ) 
            )
      ORDER BY ticket.id
     ) DAL_ROWNOTABLE 
WHERE rownum <= 21;

ORA-00936 usually indicates a syntax error.

ROWNUMBER is not an Oracle function. Unless you have a user-defined function of that name I suspect the function you're looking for is ROW_NUMBER().

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!