General SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesGeneral SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old June 26th, 2006, 08:59 AM
venuwin28 venuwin28 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2006
Posts: 3 venuwin28 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 m 50 sec
Reputation Power: 0
Problem building query

Hi,
my problem is this :

I have a table like this
---------------------------------------------
Name EmployeeID SupervisorID
---------------------------------------------
Allen 2 3
Smith 3 2
Jack 4 3
Harrison 5 4

I want to retrieve the list of applicable supervisorIDs by passing current UserID - the result should not contain the currentUserID,UserID of his supervisor and the UserID of persons who are supervisors of his supervisor.

To make it clear , if i retrieve the list of supervisors that can be applied to Smith , the query should return only Allen and not Jack and harrison because they are lower in the Organisational hieararchy.

Pls help me in building the query..I tried out NOT IN ..but doesnt work..


Thanks in advance,
Sundaram Venu

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesGeneral SQL Development > Problem building query


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT