2

I'm trying to create a virtual layer starting from a municipality layer and from a table of attributes, both stored in a Postgresql DB.

So I've done a join like:

*SELECT munic, country_of_origin, SUM (presence), munic.NOME FROM ps JOIN munic ON munic.pro_com = ps.pro_com WHERE country_of_origin = 'Germany' GROUP BY munic.NOME ORDER BY munic.NOME DESC* 

I've set the geometry fields in the mask, I see the join in the attribute table, but I can't see the map

Any ideas?

3
  • 3
    "even if i've set the geometry fields in the mask" ... what do u mean ? Commented May 23, 2018 at 13:10
  • 2
    Do you need to add a geometry field to your selection? In a quick test, doing "SELECT ID from foo" fails, but "SELECT ID,ID.geometry from foo" works for me. ("SELECT * from foo" also works) Commented May 23, 2018 at 13:16
  • 1
    It's not enough to list the geometry column -- if a GROUP BY is present, you need to use an aggregation function on the geometry (or to restructure so that the geometry is outside the aggregation). Commented May 23, 2018 at 13:24

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.