How to filter data conditional on two columns

could there be a case like the following?
if so, what would the expected result be?

df = DataFrame(
               branch = [1,1,2,1,1,2,2], 
               from = [1,2,3,4,1,1,6],
               to = [4,7,1,1,4,3,9]
               )