To make the usage of sql queries more flexible in dbforms, you can use the query element which can be used to:
Create group by with flexible where part.
Create joined sql with a flexible join statement
Create an alias of an existing table
Make dynamic changes of the query which prevents the use of a view in the database.