Skip to content
Advertisement

Multiple joins on same table

I’m trying to achieve a query which seems simple but I can’t make it work correctly. Here’s my database tables structures:

Here’s what i want to achieve:

Mutliple members can register to an activity. Then, i group the registrations by tandems. I want a view with all the tandems listed and there’s my problem. When I try a query, it gives me multiple rows, duplicated many times.

Below, an example of the table I want to have:

Here’s the query I’m working on:

Any help appreciated!

Advertisement

Answer

The error is caused by joining wrong column (member_id) of registrations table with tandems table, instead column registrations.id should be used.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement