I have a layer with some geometries and a data layer that defines an M:N relation. Is there any way I could select (on the map) objects that are in relation with specific id? Basically I would like to select by expression like
object_id in (select object_id from relations where relative_id = 12345)
I can do that from the db manager select * from objects where object_id in
..., but that means creating new layer each time, which is extra work and needs to be deleted or there would soon be hundreds of them. And the qgis joins don't seem to support M:N relations. Is there a way to select (in qgis, not sql sense) by such query?
The layers happen to be in spatialite database. They look something like
create table objects (object_id integer primary key, geometry, attributes...);
create table relations (object_id integer references objects (object_id),
relative_id integer references something);