Note that there are some explanatory texts on larger screens.

plurals
  1. POWeird many to many and one to many relationship
    primarykey
    data
    text
    <p>I know I'm gonna get down votes, but I have to make sure if this is logical or not.</p> <p>I have three tables A, B, C. B is a table used to make a many-many relationship between A and C. But the thing is that A and C are also related directly in a 1-many relationship</p> <p>A customer added the following requirement:</p> <p>Obtain the information from the Table B inner joining with A and C, and in the same query relate A and C in a one-many relationship</p> <p>Something like:</p> <p><a href="http://img247.imageshack.us/img247/7371/74492374sa4.png" rel="nofollow noreferrer">alt text http://img247.imageshack.us/img247/7371/74492374sa4.png</a></p> <p>I tried doing the query but always got 0 rows back. The customer insists that I can accomplish the requirement, but I doubt it. Any comments?</p> <p>PS. I didn't have a more descriptive title, any ideas?</p> <p>UPDATE: Thanks to rcar, In some cases this can be logical, in order to have a history of all the classes a student has taken (supposing the student can only take one class at a time)</p> <p>UPDATE: There is a table for Contacts, a table with the Information of each Contact, and the Relationship table. To get the information of a Contact I have to make a 1:1 relationship with Information, and each contact can have like and an address book with; this is why the many-many relationship is implemented.</p> <p>The full idea is to obtain the contact's name and his address book. Now that I got the customer's idea... I'm having trouble with the query, basically I am trying to use the query that jdecuyper wrote, but as he warns, I get no data back</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload