13.1.  Examples:

13.1.1. group by

In a table with:

create table 

    (cno integer not null primary key,

        type char(20) not null,

        date timestamp not null,

        value number not null



You need a query with:

Select type, sum(value) as sumValue where date < ? 
group by type having sumValue > ?

Because the date should be selected by the user, you can not use a fixed view in the database. However, this is possible using the query element in dbforms_config.xml:


            <query name="valuesGroup" from="values" groupBy=type>
    <field="type" type="char">
    <field="sumValue" expression=sum(value) type="number">
    <search="date" type="timestamp">


13.1.2. join


            <query name="viewname" from="table1 left join table2 on table1.id = table2.id">
    <field1 type=char>


13.1.3. Simple alias


            <query name="aliasname" from="table" />

  • can be used to have the same table more than once on a page.

  • inherits all field definitions from the table.

  • is updateable!

  • may be another query.