Hello!
> Hannu, does it work?
> Few months ago I lost some time trying to create this kind of query and
> I always got error, that subselect doesn't knows anything about upper
> (outer?) table.
It does not work on my PostgreSQL 7.2.x
Get the same error like you: "relation rk does not exist"
Also the disadvantage of this solution is that the speed up is bound to
queries for the ordernr. If a statement has a where clause e.g. for a
timestamp, the view is still slow.
Does PostgreSQL not know how to move where clause inside each select in a
union?
--
Dipl. Inform. Boris Klug, control IT GmbH, Germany