[MySQL] How to SELECT direct and indirect staff
-
Hi, I have a Marketing & Sales Director, the Marketing & Sales Director has one Marketing Manager and Sales Manager reporting to him. The Sales Manager has two Sales Executives and the Marketing Manager has two Marketing coordinators reporting to them. I can make a SELECT to list staff reporting to the Sales Manager and staff reporting to the Marketing Manager. I can also make a SELECT to list staff reporting to the Marketing & Sales Director (which are Marketing Manager and Sales Manager). Now I want to make a SELECT to list all staff reporting directly on indirectly to the Marketing & Sales Director including staff reporting to managers under the Marketing & Sales Director so the query should list the below when I query for staff reporting to the Marketing & Sales Director: 1. Marketing Manager 2. Sales Manager 3. Sales Executive 1 4. Sales Executive 2 5. Marketing Coordinator 1 6. Marketing Coordinator 2 How can I do this please? Thanks, Jassim[^]
Technology News @ www.JassimRahma.com
-
Hi, I have a Marketing & Sales Director, the Marketing & Sales Director has one Marketing Manager and Sales Manager reporting to him. The Sales Manager has two Sales Executives and the Marketing Manager has two Marketing coordinators reporting to them. I can make a SELECT to list staff reporting to the Sales Manager and staff reporting to the Marketing Manager. I can also make a SELECT to list staff reporting to the Marketing & Sales Director (which are Marketing Manager and Sales Manager). Now I want to make a SELECT to list all staff reporting directly on indirectly to the Marketing & Sales Director including staff reporting to managers under the Marketing & Sales Director so the query should list the below when I query for staff reporting to the Marketing & Sales Director: 1. Marketing Manager 2. Sales Manager 3. Sales Executive 1 4. Sales Executive 2 5. Marketing Coordinator 1 6. Marketing Coordinator 2 How can I do this please? Thanks, Jassim[^]
Technology News @ www.JassimRahma.com
Your signature (Jassim) points to a site seems to be commercial... It is not really accepted here and can cause you to be banned for spamming... Please remove it (or restore it to its previous value - your personal site)!
Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.
-
Your signature (Jassim) points to a site seems to be commercial... It is not really accepted here and can cause you to be banned for spamming... Please remove it (or restore it to its previous value - your personal site)!
Skipper: We'll fix it. Alex: Fix it? How you gonna fix this? Skipper: Grit, spit and a whole lotta duct tape.
I suspect it may be a site he created, or at least customised the template for!
Never underestimate the power of human stupidity RAH
-
Hi, I have a Marketing & Sales Director, the Marketing & Sales Director has one Marketing Manager and Sales Manager reporting to him. The Sales Manager has two Sales Executives and the Marketing Manager has two Marketing coordinators reporting to them. I can make a SELECT to list staff reporting to the Sales Manager and staff reporting to the Marketing Manager. I can also make a SELECT to list staff reporting to the Marketing & Sales Director (which are Marketing Manager and Sales Manager). Now I want to make a SELECT to list all staff reporting directly on indirectly to the Marketing & Sales Director including staff reporting to managers under the Marketing & Sales Director so the query should list the below when I query for staff reporting to the Marketing & Sales Director: 1. Marketing Manager 2. Sales Manager 3. Sales Executive 1 4. Sales Executive 2 5. Marketing Coordinator 1 6. Marketing Coordinator 2 How can I do this please? Thanks, Jassim[^]
Technology News @ www.JassimRahma.com
Not enough info, how's your tables looking like?
Wrong is evil and must be defeated. - Jeff Ello
-
Not enough info, how's your tables looking like?
Wrong is evil and must be defeated. - Jeff Ello
In employees table: 1. employee_number 2. first_name 3. last_name In employee_job 1. employee_number 2. reporting_to (refers to employees->employee_number)
Technology News @ www.JassimRahma.com