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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值