I have a table like this:
i1   i2
----------
1    a
1    b
1    c
1    d
2    x
3    y
4    a
4    b
4    c
I want to select the rows between 1 c and 4 a. 
The result should be:
1 c
1 d 
2 x 
3 y 
4 a
How can I do this?
I would do this as:
select t.*
from t
where (i1 > 1 or (i1 = 1 and i2 >= 'c')) and
      (i1 < 4 or (i1 = 4 and i2 <= 'a'));
                        If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With