Please consider following setup

```
Control Group   Sequence
-------------------------
Cont1   Group1  0
Cont2   Group1  1
Cont3   Group1  2
Cont3   Group2  0
Cont2   Group2  1
Cont1   Group2  2

```

Increment sequence with +1 for sequence >= sequence of cont2 and for respective Group

The result should be

```
Control Group   Sequence
------------------------
Cont1   Group1  0
Cont2   Group1  2
Cont3   Group1  3
Cont3   Group2  0
Cont2   Group2  2
Cont1   Group2  3

```

Can any one help me to construct a SQL query to get above result?