I have a query which outputs a table with an unique nodeID and x-,y-coordinates.
How can I import this query result table into qgis as an point-layer?
I have tried it with the DB-Manager (see below) and by WFS. But both hasn't worked out for me although I was able to specify a query.
The following shows you the SQL query I am running to get my result query table which I want to import in QGIS as point-layer:
SELECT "from" AS nodeID, st_x AS x, st_y AS y, priority AS type FROM (SELECT "from", st_x(st_pointn(geom,1)), st_y(st_pointn(geom,1)) FROM public.graph UNION SELECT "to", st_x(st_pointn(geom,st_npoints(geom))), st_y(st_pointn(geom,st_npoints(geom))) FROM public.graph ORDER BY "from") AS nodes INNER JOIN junctions on nodes."from" = id