I have a PostGIS layer in my QGIS project whose id is related to a NON-SPATIAL table in the same database. I cannot join these tables into a new table or view, I have to leave the database exactly intact is it is.
Is it possible to create a labelling expression that will perform a tabular join on the fly inside the database to return the value?
Essentially I need return a label expression with something that would do this:
SELECT
non_spatial_table.label
FROM
spatial_table, non_spatial_table
WHERE
spatial_table.key = non_spatial_table.key
Where spatial_table
is the table driving the QGIS layer.