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表达式之“ora-0079”不是group by表达式分析(未完待续。。。)
最新推荐文章于 2024-09-03 08:15:00 发布
本文针对在进行复杂数据库操作时遇到的错误进行了详细分析,并通过使用sys_connect_by_path函数解决了问题,但作者对于这一解决方案仍有疑问。
&spm=1001.2101.3001.5002&articleId=77855656&d=1&t=3&u=777a3dd94b1f43a195df6aad98237b44)
1万+

被折叠的 条评论
为什么被折叠?



