Feature request #15938

Specify type of Join

Added by Harry Clarke 4 months ago.

Status:Open Start Date:12/05/2016
Priority:Normal Due date:
Assigned to:- % Done:

0%

Category:-
Target version:Version 3.0
Platform:Windows Resolution:
Platform version: Pull Request or Patch supplied:No
Status info: Tag:

Description

In the layer properties in QGIS Desktop, add the ability to specify the type of Join of two layers. At present only an INNER JOIN is performed.

For example, I wish to implement the following equivalent code within QGIS
i.e. I want to display all records, which have a parent with name "xx"

SELECT * FROM table_1, table_2, table_3
WHERE table_1.foreign_key = table_2.key AND table_3.foreign_key = table_2.key AND
table_2.parent_key = (SELECT table_3.foreign_key, WHERE table_3.name = "xx")

From the following MS SQL Server tables
table_1
with fields - id, foreign_key, geom
table_2
with fields - key, parent_key, etc.
table_3
with fields - id2, foreign_key, name, preferred

Tables 1 and 2 are of the same length
The field "parent_key" allows the objects to be arranged in a hierachical fashion.
Table 3 allows several names to be attached to the same object, with the field "preferred" indicating the preferred name. Hence table_3

is longer than table_2.

At present, if the 3 tables are joined within the Layer properties, then only the first entry from table_3 is included, rather than what is required are all rows, so that the preferred names can be selected.

Also available in: Atom