Hello all,
This is my first time on the forums, so please bear with me. Im also a somewhat novice SQL coder but I have a question that I feel might be best answered my the more advanced folks on this forum.
I have 3 tables, a user table, a group table and a membership table.
Say:
user_table +-------------------+ | user_PK | | Id | | Name | | Description | +-------------------+ Group_table +-------------------+ | group_PK | | Id | | Name | | Description | +-------------------+ Group_members +----------------------+ | group_members_PK | | Group_ID | | Member_ID | | Member_type | +----------------------+
The group_ID is linked to the Group_table.ID and the Member_ID can be either linked back to the group_table or user_table depending on the value of member_type.
It is possible to have nested groups, and each level of nesting can have users as well not just nested groups. Sort of how the windows group nesting model works.
I would like to end up with being able to have output that lists only users, their descriptions and their nested group path if any.
If you need more clarification please let me know. I know this maybe a simple thing, but Im unsure how to do it. Thanks in advance.