views

created onApril 24, 2017

Creating a materialzed View from three tables (Example)

CREATE MATERIALIZED VIEW resourceentityview AS SELECT r.id, b.basename, rk.rkey AS key, p.id AS persistablelocale, r.value FROM resourceentity r, basename b, resourcekey rk, persistablelocale p WHERE r.resourcekey = rk.id AND rk.basename = b.id AND r.persistablelocale = p.id ORDER BY b.basename, p.id, rk.rkey WITH DATA; ALTER TABLE resourceentityview OWNER TO alice;