Skip to content
Advertisement

Filter rows over partitions

Suppose I have the following table:

If a nGroup has one Status to INPROGRESS, then return only the lines of that group containing the status INPROGRESS.

If all the Status of a nGroup are different from INPROGRESS, then return all the status available for that group.

So for this example, I would get the following output:

I tried the following query :

But I get the following error when running it :

Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.

Advertisement

Answer

This will do it:

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement