I have a solution but it is only possible if you have a column for sequence number too:
let me tell you what i did
the table:
a --------- b --------- seq
-----------------------------
a --------- b --------- 1
b --------- b --------- 2
c --------- b --------- 3
d --------- e --------- 4
e --------- f --------- 5
f --------- b --------- 6
g --------- b --------- 7
h --------- i --------- 8
i --------- a --------- 9
column name shown in bold. data in normal font and underlined values are possible candidate to come out in correct answer.
Now for this table the following query will give you the desired results;
with tempTable as
(
select t1.a as val, ROW_NUMBER() over (order by t1.seq) as newRowId from table_1 t1, table_1 t2 where (t1.seq - t2.seq) = 1
)
select distinct t3.b from Table_1 t3, tempTable T where T.newRowId = t3.seq and t3.b = val
the result will be
b
e
f
i
I hope you understood what I did and hopefully the query will help.