Several colleagues of mine have asked whether it is possible to
visualise the results of a SELECT
statement on a PostGIS database
that returns spatial data in QGIS. In other words, can we map the
results of something like:
SELECT id, st_union(the_geom) FROM spatial_table GROUP BY id;
My usual answer to this in the past has been “not yet…”, but now thanks to Giuseppe Sucameli and Jürgen E. Fischer, the answer is a resounding “yes!”. A recent patch to QGIS trunk now makes custom Postgres queries possible via the postgres data provider.