Skip to content
Advertisement

Is there any way in Oracle to skip a value in a select when it has been already shown?

Sorry because maybe it’s a silly question but honestly I don’t know how to handle it. Let’s imagine that after executing a select with a group by clause I have the following information:

But I would like to obtain the following:

In other words, I don’t want to show a previously shown value if it’s the same (in this case, value1 and value2)

Is this feasible with Oracle? if the answer if yes, would you kindly point me in the right direction?

Thank you.

Advertisement

Answer

You don’t say what’s the ordering criteria for the rows so I’ll assume it’s (col1, col2).

The query you want should look like:

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