When you use sequential search, you use several steps to find the central feature. Each step improves the results with different SQL statements.
Each step has a select statement and a title for the query. The geometry query is optional. The select statement returns some result rows.
The first attribute contains the key (mandatory); the second attribute contains a text string (optional).
The values of the result rows are usually elements in the subsequent searches. They can be used in the subsequent select statements with the help of placeholders.
Every select statement (except the first one) can access the values of the rows returned by the previous search. This is also true for the geometry queries. When a result row of a select statement has a geometry attribute, you can create a geometry query for that search. The geometry query will always look like this:
Select geom from <table> where fid = {x}
In this query, you select only the geometry attribute. The WHERE clause is composed of the primary key attribute and the current ID of the previous returned row. The placeholder {X} is replaced by the ID of the selected result row (X=0 for the first select statement).