QUEL User Notes for a Join
When you generate a report from a joined table, you must simulate the .need statement to assure proper page breaks. In QUEL, this involves making the same alterations to the report specifications file as shown in the text, but no additional tables need to be constructed.
Here is the query statement for the final report specification:
.NAME booksq
.OUTPUT booksq.out
.LONGREMARK
The BOOKSQ report uses previously executed QUEL
statements to create a temporary table,tempbooksq
which is the join of books, authors and subject.
.ENDREMARK
.QUERY
range of b is tempbooksq
retrieve (b.all,
num_auths=count(b.subject by b.id where
b.code=1),
num_sub=count(b.subject by b.id where b.code=2)
)
...