Advertisement

05.02.2007 at 05:23AM PDT, ID: 22547257
[x]
Attachment Details

Recursive SQL Query

Asked by jeffbeasley in Databases Miscellaneous, MS SQL Server, SQL Query Syntax

Tags: , ,

I need to write a recursive query with the following conditions...I have a table called 'contracts' that can have 1 to may possible sales people attributed to it...each salesperson belongs to a group(could be same group or different groups)...each salesgroup reports to 1 or 0 other salesgroups...each sales group consists of 1 to many salespeople...if 2 salespeople in group A report to group B and group B reports to group C I need all sales people from the reported to groups as well as the salespeople associated with the sale...I also need each group to break down the contract percentage of sale for each person...the query should return an id and a percentage...Other conditions...the initial sales people may not belong to the same group...


Start Free Trial
[+][-]05.02.2007 at 05:51AM PDT, ID: 19015260

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.02.2007 at 05:58AM PDT, ID: 19015314

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.02.2007 at 05:59AM PDT, ID: 19015322

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.02.2007 at 06:04AM PDT, ID: 19015353

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.02.2007 at 06:34AM PDT, ID: 19015593

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.05.2008 at 06:22PM PDT, ID: 21504180

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Databases Miscellaneous, MS SQL Server, SQL Query Syntax
Tags: recursive, sql, query
Sign Up Now!
Solution Provided By: RQuadling
Participating Experts: 3
Solution Grade: A
 
 
[+][-]05.12.2008 at 01:34AM PDT, ID: 21545322

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32