Ab V5 geht auch folgendes Konstrukt:

with
Tempfile as (select ...from ... where ...)
select tempfile.*, (select count(*) from tempfile) as counter from tempfile

man erhält damit ein zusätzliches Feld mit der Anzahl Sätze pro Fetch