4

I want to join two tables. The second table has only one row. I want to append this row to every row of table 1. How can I achieve that with SQL in QGIS3?

enter image description here

2 Answers 2

5

Create a "Virtual Layer" (Layer Menu > Create Layer > New Virtual Layer...) and use this query:

SELECT * FROM table1
LEFT JOIN table2

Then you can export as another format.

enter image description here

4

You can use "Vector general > Execute SQL" tool.

Select "No geometry", specify a file path and use this query:

SELECT * FROM table1
LEFT JOIN table2

enter image description here

Result:

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.