我有这个查询 " T$ L1 f K1 I1 }5 ~SELECT DAL_ROWNOTABLE.DAL_ID FROM SELECT ticket.id AS "DAL_ID", ROWNUMBER ( Order By ticket.id ) AS "DAL_ROWNUMBER" FROM ticket_table ticket WHERE ( ticket.type = N'I AND ticket.tenant IS NULL OR ticket.tenant IN SELECT * FROM SELECT tenant_group_member.tenant_id FROM tenant_group_member WHERE tenant_group_member.tenant_group = HEXTORAW('30B0716FEB5F4E4BB82A7B7AA3A1A42C ORDER BY ticket.id ) ) ) )DAL_ROWNOTABLE WHERE DAL_ROWNOTABLE.DAL_ROWNUMBER BETWEEN 1 AND 21引发ORA-00936缺乏表达式allow查询有什么问题?任何人?任何帮助都将不胜感激…在第一顺序的开头,列出80个错误: ! a) a1 \0 {5 Y4 g. j7 b 9 [& X% w) P1 c2 D* w/ _- i/ @ 解决方案: : Z: J' n2 I9 g2 a' P1 N. W& I
你的查询可以大大简化。它有额外的层,如子查询order by在in子查询中不必要的东西。你想做什么就做什么rownumber可以rownum: 5 }8 d% t( m2 S7 N7 E6 }+ a6 B3 zSELECT DAL_ROWNOTABLE.DAL_IDFROM (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 <=