sql - ORA-00937: not a single-group group function when using rownum -


i ora-00937 error when firing below query.

query:

select *   (select streetid,     roadid,     listagg(longitude ,',') within group ( order sequence_number) long_agg ,     listagg(latitude ,',')  within group ( order sequence_number) lat_agg ,     rownum r   linkstable   areaid = 100  group strretid,roadid ) r > 100 , r < 200; 

error:

 ora-00937: not single-group group function 00937. 00000 -  "not single-group group function" 

extending gordon's solution, workaround using rownum

with street_list (  select streetid,     roadid,     listagg(longitude ,',') within group ( order sequence_number) long_agg ,     listagg(latitude ,',')  within group ( order sequence_number) lat_agg ,   linkstable   areaid = 100  group strretid,roadid  ), street_list_numbered (   select rownum r,streetid,roadid, long_agg,lat_agg   street_list ) select * street_list_numbered r > 100  , r <  200; 

Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -