Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个表名测试,它有三列 id、m_id 和 s_m_id
我正在执行以下查询
select id,test.nextval listagg(m_id || ',' || s_m_id, ';') within group (order by m_id) as merge_ids from test t group by id
比我收到错误 ORA - 02287 此处不允许序列号。
你试图一口气做太多的事情。为分组创建一个子查询并稍后添加序列号:
select id, test.nextval, merge_ids from ( select id, listagg(m_id || ',' || s_m_id, ';') within group (order by m_id) as merge_ids from test t group by id )