nagasadhu Beginner
Joined: 08 Jul 2006 Posts: 17 Topics: 6
|
Posted: Mon Feb 12, 2007 12:36 pm Post subject: looping query |
|
|
Hi
I have a customer table with
Code: | ---------------------------------------
Acc_No. Customer_id Priority
----------------------------------------
(char10) decimal(9,0) char(1)
----------------------------------------
111 1 1
222 2 1
222 3 2
333 3 1
333 4 2
444 2 1
444 4 2
555 4 1
555 5 2 |
I pass the customer_id to the query. I need the complete list of Customer_id that are related with the id passed directly or indirectly. Only 1& 2 priorities are possible.
For Customer_id
Input - 1
Output : 1
Input - 2
Output - 2,3,4,5
Input - 5
Output -5,4,3,2
Thanks for your time & effort
Regards |
|