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

请注意,当我的意思是“将具有特定条件的行放在一起”时,我使用“分区”一词,因为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中这样做吗?如果是这样,那会是一个好方法吗?