<div dir="ltr"><div dir="ltr"><div>Hi</div><div><br></div><div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Sep 19, 2019 at 3:10 PM Janneke van Dijk <<a href="mailto:janneke.qgis@gmail.com">janneke.qgis@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>What I can do with the DB manager is:<br>
<br>select location_point.geom, asset_point.assetid, location_point.fid  <br>from asset_point cross join location_point on asset_point.locationid = <br>location_point.fid<br>
<br></blockquote><div><br></div><div>This should work, but why the CROSS JOIN? a simple join should be enough.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">this query yields 170 records, corresponding with the number of records <br>in the assets table. When I load as a new layer, the result is a table <br>with 170 records, but 100 filtered (the total number of locations). I <br>chose assetid to be the unique id (which it is).<br>
<br>Is that expected behaviour? How else can I display all the records in <br>the assets table (instead of only the 100 that are filtered now)? I know <br>I can do it in Postgres but for my purpose now I don't want to go there.<br>
<br></blockquote><div><br></div><div>An alternative is to create a relation between the two tables, the assets will show in the location feature form. You can even add more assets to a certain location.</div><div><br></div><div>Check more info here:<br><br><a href="https://docs.qgis.org/3.4/en/docs/user_manual/working_with_vector/attribute_table.html?highlight=relation#introducing-1-n-relations">https://docs.qgis.org/3.4/en/docs/user_manual/working_with_vector/attribute_table.html?highlight=relation#introducing-1-n-relations</a></div><div><br></div><div>Hope it helps.</div><div><br></div><div>Alexandre Neto<br></div><div> </div><br></div></div>