April 5, 2010 at 3:45 pm
I have to code a query to return a result set containing only the MemID's that are in the 2 org from the table structure and chart below... I think this needs to be done with a Stored procedure but not exactly sure how to do it.. anyone have an idea? Think of this as values for an org chart.
MemID
1
2
3
4
5
6
7
8
9
10
11
ParID
0
1
1
1
2
2
6
6
7
4
4
1
|-------|--------|
2------ 3------- 4
|----------------|
5------6 10------11
|----|
7----8
|
9
So - in this tree example the output should be: (because they all fall within the 2 MemId org...)
MemId
-------
2
5
6
7
8
9
April 5, 2010 at 4:41 pm
Please provide your table definitions, and what queries you have tried so far.
This will be more helpful and more consumable by the community trying to help you.
Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
April 5, 2010 at 7:20 pm
CirquedeSQLeil (4/5/2010)
Please provide your table definitions, and what queries you have tried so far.This will be more helpful and more consumable by the community trying to help you.
I agree with Jason... we need some data and we need to know what the table(s) look like. Now, don't just run off and try to do that without reading the article at the first link in my signature line below.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply