<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
To understand you correct:<br>
<br>
In your raw-data table entrants you have one row for each person and
in your query you want one flow for each person, ie. the same number
of rows in your output?<br>
<br>
In the regards to the group by, you want the sum(ipondi) on each
flow where they're grouped by a specific field?<br>
<br>
Is the above understood correctly?<br>
<br>
(The way aggregates work is that you need to group by all
non-aggregrate, so it will find all unique combinations of the other
fields in the query and sum based on those.)<br>
<div class="moz-signature"><font face="Tahoma"> <br>
Mvh. / Best regards</font><br>
<div class="moz-signature"><font face="Tahoma"> </font><font
face="Tahoma">Casper Bertelsen</font><font face="Tahoma"><br>
<br>
Mail: <a class="moz-txt-link-abbreviated" href="mailto:casperbj94@gmail.com">casperbj94@gmail.com</a></font><br>
<div class="moz-signature"><font face="Tahoma"> <br>
</font></div>
</div>
</div>
<div class="moz-cite-prefix">On 03-02-2018 21:07, image wrote:<br>
</div>
<blockquote type="cite"
cite="mid:1517688450924-0.post@n6.nabble.com">
<pre wrap="">So, i succeed in executing the query without error message. The query
generates a temp postgis layer linear.
I attach the SS below showing the qgis canvas
<a class="moz-txt-link-rfc2396E" href="http://osgeo-org.1560.x6.nabble.com/file/t365144/6.jpg"><http://osgeo-org.1560.x6.nabble.com/file/t365144/6.jpg></a>
But i have always a problem regarding the GROUP BY...i would like to do a
GROUP BY one field only...but i can't generate the query without put all
fields present in SELECT into GROUP BY !
Please read my currently query :
create table temp as select
st_makeline(st_makepoint(entrants_v2.x_resi,entrants_v2.y_resi),st_makepoint(entrants_v2.x_tr,entrants_v2.y_tr))as
geometry,sum(entrants_v2.ipondi) as sumipondi, entrants_v2.codgeo_res as
codgeo_res, entrants_v2.codgeo_tr as codgeo_tr
from entrants_v2
group by
entrants_v2.codgeo_res,entrants_v2.x_resi,entrants_v2.y_resi,entrants_v2.x_tr,entrants_v2.y_tr,entrants_v2.ipondi,entrants_v2.codgeo_tr
Is it a way to assign one field into group by with postgis? Because my
result is false.
In advance, thank you very much.
--
Sent from: <a class="moz-txt-link-freetext" href="http://osgeo-org.1560.x6.nabble.com/QGIS-User-f4125267.html">http://osgeo-org.1560.x6.nabble.com/QGIS-User-f4125267.html</a>
_______________________________________________
Qgis-user mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a>
List info: <a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/qgis-user">https://lists.osgeo.org/mailman/listinfo/qgis-user</a>
Unsubscribe: <a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/qgis-user">https://lists.osgeo.org/mailman/listinfo/qgis-user</a></pre>
</blockquote>
<br>
</body>
</html>