Use di AND and OR in query through Advanced Search in Grid

  1. I would need to use the AND and OR mixed clauses in Grid Search
    What I found in Search is all AND or all OR
    Example :
    SELECT * FROM table_a WHERE f1 = ‘R1’ AND (f2 = 100 OR f3 = 150)

  2. How are the new fields inserted in Advanced Search used?
    How do you associate them with database fields to build the query?
    Example :
    SELECT * FROM table_a WHERE f1 = ‘R1’ AND (f2 = {new_field1} OR f3 = {new_field2})

Is there a way?
Thank you
Hello
Enrico