Feature request #15938

Specify type of Join

Added by Harry Clarke over 7 years ago. Updated almost 6 years ago.

Pull Request or Patch supplied:No Resolution:
Easy fix?:No Copied to github as #:23854


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
with fields - id, foreign_key, geom
with fields - key, parent_key, etc.
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.


#1 Updated by Giovanni Manghi about 7 years ago

  • Easy fix? set to No

#2 Updated by Regis Haubourg about 7 years ago

  • Category set to Relations
  • Description updated (diff)

#3 Updated by Harry Clarke almost 6 years ago

Checked - feature still not present in QGIS 3.2.1

Also available in: Atom PDF