Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

One to many / many to one joins #19775

Closed
qgib opened this issue Oct 27, 2014 · 10 comments
Closed

One to many / many to one joins #19775

qgib opened this issue Oct 27, 2014 · 10 comments
Labels
Feature Request Feedback Waiting on the submitter for answers Forms stale Uh oh! Seems this work is abandoned, and the PR is about to close.

Comments

@qgib
Copy link
Contributor

qgib commented Oct 27, 2014

Author Name: Ed Hudspeth (Ed Hudspeth)
Original Redmine Issue: 11505

Redmine category:relations


Currently, any join performed on a table is a one to one join - it would be great to perform one to many joins.

Example:
Table A = Towns
Table B = Customers (aspatial)

Join on Town name - currently only returns the first customer name it gets to, it would be good to list all.

@qgib
Copy link
Contributor Author

qgib commented Oct 29, 2014

Author Name: Matthias Kuhn (@m-kuhn)


QGIS relations offer the possibility to define a 1:N relation and integrate with the feature form.

http://fulcrumapp.com/blog/using-relations-in-qgis/
http://blog.vitu.ch/10112013-1201/qgis-relations


  • status_id was changed from Open to Closed

@qgib
Copy link
Contributor Author

qgib commented Oct 29, 2014

Author Name: Ed Hudspeth (Ed Hudspeth)


But this doesn't allow you to update a table - you have to click on each object. What about tables with 1000s of records - really need to see the join functionality extended at least to allow you to concatenate all results rather than just take the first.

@qgib
Copy link
Contributor Author

qgib commented Jul 13, 2015

Author Name: Mathieu Pellerin - nIRV (Mathieu Pellerin - nIRV)


I don't think this should be closed.

What is needed here is for the join functionality to allow for a 1-to-many join (like an SQL operation would do). It's useful and at times needed to do time series animation through TimeManager, etc.

@qgib
Copy link
Contributor Author

qgib commented Aug 24, 2015

Author Name: Miroslav Umlauf (@mirouml)


I also disagree with closing this. Integration with feature form doesn't really cut it in the case that somebody needs to create new dataset/table which includes all 1:N variations.

@qgib
Copy link
Contributor Author

qgib commented Aug 15, 2017

Author Name: infobleep - (infobleep -)


The ability to do open to many queries is extremely useful. The ability to return one table with all the records joined is also useful.

Imagine if one to one joins only worked as relations did. Now would that be as useful as the existone one to one join geoprocessing function? I personally think not. Thus I feel it is the same with the one to many joins.

I'd like many to many joins, aka full joins but I appreciate that would be technically complex to impliment.


  • description was changed from Currently, any join performed on a table is a one to one join - it would be great to perform one to many joins.

Example:
Table A = Towns
Table B = Customers (aspatial)

Join on Town name - currently only returns the first customer name it gets to, it would be good to list all.

to Currently, any join performed on a table is a one to one join - it would be great to perform one to many joins.

Example:
Table A = Towns
Table B = Customers (aspatial)

Join on Town name - currently only returns the first customer name it gets to, it would be good to list all.

  • status_id was changed from Closed to Reopened
  • category_id was configured as Processing/QGIS

@qgib
Copy link
Contributor Author

qgib commented Aug 15, 2017

Author Name: Giovanni Manghi (@gioman)


infobleep - wrote:

The ability to do open to many queries is extremely useful. The ability to return one table with all the records joined is also useful.

Imagine if one to one joins only worked as relations did. Now would that be as useful as the existone one to one join geoprocessing function? I personally think not. Thus I feel it is the same with the one to many joins.

I'd like many to many joins, aka full joins but I appreciate that would be technically complex to impliment.

am I missing something? don't we have 1:n and n:m relations since a long now?


  • status_id was changed from Reopened to Feedback
  • category_id was changed from Processing/QGIS to Relations

@qgib qgib added Feedback Waiting on the submitter for answers Feature Request Forms labels May 25, 2019
@haubourg
Copy link
Member

Cleaning session:

I think we have relations usefull for forms and individual edits.
We have relational expressions allowing to do updates on several tables
We have virtual layer to take benefit of SQL power on any datasource
We have real databases underneath to play seriously when needed.

I think the need raised here is inspired by ArcXXX that allows to propagate selections with one-to-many relations. I've always found it was a really unstraightful and cumbersome way of doing relational updates.
I personaly wouldn't go this way, but if someone has clear ideas of what to bring feel free.

@kylefelipe
Copy link

To join tables 1:N, N:N we can use DB Manager to load a new layer, and then save as file...
Just navigate to Virtual Layers > Qgis Layer

image
Select an layer and start a new SQL window...
U can use SQLite sintax to perform the join...

https://sqlite.org/index.html
http://www.sqlitetutorial.net/

@github-actions
Copy link

The QGIS project highly values your report and would love to see it addressed. However, this issue has been left in feedback mode for the last 14 days and is being automatically marked as "stale".
If you would like to continue with this issue, please provide any missing information or answer any open questions. If you could resolve the issue yourself meanwhile, please leave a note for future readers with the same problem and close the issue.
In case you should have any uncertainty, please leave a comment and we will be happy to help you proceed with this issue.
If there is no further activity on this issue, it will be closed in a week.

@github-actions github-actions bot added the stale Uh oh! Seems this work is abandoned, and the PR is about to close. label Jul 14, 2021
@github-actions
Copy link

While we hate to see this happen, this issue has been automatically closed because it has not had any activity in the last 42 days despite being marked as feedback. If this issue should be reconsidered, please follow the guidelines in the previous comment and reopen this issue.
Or, if you have any further questions, there are also further support channels that can help you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request Feedback Waiting on the submitter for answers Forms stale Uh oh! Seems this work is abandoned, and the PR is about to close.
Projects
None yet
Development

No branches or pull requests

3 participants