SQL Server recursion generating full nested membership
I am able to generate a recursion query thanks to this post here: SQL Server recursion with multiple tables
SQL Server recursion with multiple tables
I’m trying to get users that are part of groups, but groups can be members of groups as well. So the question is about who has “effective” access to certain groups. I’ve seen many examples of using CTE on SQL Server and this seems like the same case, but all the examples are pretty simple about a single table like an org chart. In my case, I have to join multiple tables and just can’t grasp the whole recursion thing.
How to write a SQL query to group accounts that share same phone numbers directly or indirectly in recursive way?
I am trying to group a list of accounts if they share same phone numbers directly or indirectly using SQL query in recursive way. I was trying traversing the parent-child hierarchy like most SQL recursive examples do, but it doesn’t work because each parent in my case could have multiple children.