Oracle:遍历分区/组及其子分区/组

时间:2015-10-02 10:33:54

标签: oracle loops plsql partitioning

我想知道是否可以在PL / SQL中实现以下步骤。

请注意我使用"分区"当我的意思是"将具有特定条件的行放在一起时#34;因为a)我想避免使用" group"因为它结合了SQL中的行,b)我的研究到目前为止让我认为" PARTITION BY"条款可能是我想要的:

1. Select rows based on a long query with many joins, 
partition the results based on a certain column value of type LONG.

2. Loop through each row of a partition and partition again, 
based on another column of type VARCHAR. 
Do that for every partition. 

3. Loop through each row of the resulting sub-partition, compare multiple columns 
with predefined values, set a boolean column to true or false based on the result. 
Do that for every sub-partition.

使用普通的编程语言(例如Java)对我来说真的很容易。但我可以在PL / SQL中这样做吗?如果是这样,那会是一个好方法吗?

0 个答案:

没有答案