【发布时间】:2011-03-07 17:26:12
【问题描述】:
你能用什么就行了
Select * from table(cast(select * from tab1 inner join tab2)) inner join tab3
考虑到 table(cast()) 中的内容比涉及块的简单选择要复杂得多,例如 with test as (select) select *... 等。
我需要一种简单的方法来执行此操作,最好不需要临时表。
谢谢。
数据库:Oracle 10g
乐:
我有类似的东西
Select a.dummy1, a.dummy2, wm_concat(t2.dummy3)
from table1 a,
(with str as
(Select '1,2,3,4' from dual)
Select a.dummy1, t.dummy3
from table1 a
inner join
(Select regexp_substr (str, '[^,]+', 1, rownum) split
from str
connect by level <= length (regexp_replace (str, '[^,]+')) + 1) t
on instr(a.dummy2, t.split) > 0) t2
where a.dummy1='xyz'
group by a.dummy1, a.dummy2
主要思想是 t2.dummy3 列包含 CSV。这就是为什么我从双重中选择'1,2,3,4'。 我需要找到至少包含 str 中的一个值的所有行。
使用任何类型的循环都是不可能的,因为我需要进一步将它集成到用于 SSRS 中的报告的更大查询中,并且为此所需的表非常大(>100 万行)
【问题讨论】: