with tab as (select t.object_pid, t.mesh, round(x, 8) x, round(y, 8) y, round(z, 3) z, id from had_object_box_pole t, table(sdo_util.GetVertices(t.geometry)) g),tab1 as (select t.object_pid, t.mesh, t.x, t.y, t.z, t.id, count(*) over(partition by t.object_pid, t.x, t.y, t.z) num, row_number() over(partition by t.object_pid, t.x, t.y, t.z order by t.id) sq from tab t where t.id > 1),tab2 as (select t.object_pid, t.mesh, t.x, t.y, t.z, t.id, t.num, t.sq, (t.x || ',' || t.y || ',' || t.z) str from tab1 t where num > 1),tab3 as (select object_pid, t.id, mesh, substr(sys_connect_by_path(str,'|'),2) strVal, wm_concat(t.id) strid from tab2 t where connect_by_isleaf = 1 start with sq = 1 connect by sq = PRIOR sq + 1 and object_pid = PRIOR object_pid and sq < =(select max(sq) from tab2) group by object_pid,t.id,mesh)select * from tab3 t3
在進行資料庫操作時,進行tab3的選取時出現如題的錯誤,起初按照網上說的在select 清單項目中出現的列必須出現在group by後面(彙總函式除外),但是不能正確,找到的替代件決辦法還是採用substr(sys_connect_by_path)將id進行拼串。但是這個問題解決不了是心中的一塊結啊。