anchor.diff:              %% query like `a = 10 AND a > 8` we can eliminate the greater than
               %% clause because if a to be 10 it must also be greater than 8
               {eliminate, Acc};
  -        #filtercheck{'>=' = {_,_,{const,GteVal}}} when GtVal =< GteVal ->
  +        #filtercheck{'>=' = {_,_,{const,GteVal}}} when GtVal >= GteVal ->
               %% query like `a >= 10 AND a > 8` we can eliminate the greater than
               %% clause because if a to be greater than or equal to 10 it must
               %% also be greater than 8
               {eliminate, Acc};
  +        #filtercheck{'>=' = {_,_,{const,GteVal}} = F_x} = Check1 when GtVal < GteVal ->
  +            %% query like `b >= 10 AND b > 9`, the previous >= clause should be
  +            %% eliminated on the second pass
  +            Check2 = Check1#filtercheck{'>' = F, '>=' = undefined},
  +            Acc2 = store_filter_check(Check2, Acc),
  +            Acc3 = append_to_eliminate_later(F_x, Acc2),
  +            {F,Acc3};
           #filtercheck{'>' = undefined} = Check1 ->
  -            %% this is the first equality check so just record it
  +            %% this is the first greater than check so just record it
               Check2 = Check1#filtercheck{'>' = F},
               {F, lists:keystore(FieldName, #filtercheck.name, Acc, Check2)};
           #filtercheck{'>' = F_x} when F_x < F ->
  -            %% we already have a filter that is a lower value than 
  +            %% we already have a filter with a lower value than this one, so
  +            %% eliminate this one
               {eliminate, Acc};
           #filtercheck{'>' = F_x} = Check1 when F_x > F ->
               %% we already have a filter that is higher than the second one,
  
positive.code:         S?SQL_SELECT.'WHERE'
      ).
  
  greater_than_or_equal_to_that_is_less_than_previous_greater_than_clause_removes_greater_than_clause_swap_lhs_rhs_test() ->
      DDL = get_ddl(
          "CREATE TABLE table1("
          "a TIMESTAMP NOT NULL, "
  
negative.code:             %% which we can eliminate. Store it and eliminate it on the second
              %% pass since it has already been iterated
              Check2 = Check1#filtercheck{'>=' = F},
              Acc2 = store_filter_check(Check2, Acc),
              Acc3 = append_to_eliminate_later(F_x, Acc2),
              {F, Acc3}
      end;
  