oracle表达式之“ora-0079”不是group by表达式分析(未完待续。。。)

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进行拼串。但是这个问题解决不了是心中的一块结啊。

你可能感兴趣的:(ORACLE)