Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
vedjha
Posting Yak Master
228 Posts |
Posted - 2009-11-03 : 23:05:07
|
| Hello, I have to find users in there downline, I have find out but sorting is another type.as:user-sponsor-Level~~~~~~~~~~~~~~~~~~~~~~~~a-b-1b-c-2c-d-3c-e-3c-f-3c-g-3b-h-2h-H1-4h-H2-4b-i-3b-j-3j-J1-4j-J2-4a-A1-1a-A2-1A-A3-1Procedure:WITH CatTree (vaid, vspID,cplacement, damtpaid, Level,dtdoj,cstatus) AS ( SELECT vaID, vspID,cplacement,damtpaid, 1 As [Level] ,dtdoj,m.cstatus FROM members m join scratch s on m.vaid=s.vat_id join packages p on s.vpackid=p.vid WHERE vspid=@sid and cplacement='L' UNION ALL SELECT C.vaid, C.vspID,C.cplacement,C.damtpaid, Level + 1 , c.dtdoj,c.cstatus FROM members C INNER JOIN CatTree ON CatTree.vaid= C.vspid join scratch s1 on c.vaid=s1.vat_id join packages p1 on s1.vpackid=p1.vid ) SELECT * FROM CatTree where cstatus='V' Order By vspid,level,vaid -------------------------------------I have find downline but not get downline as i required.problem in sorting, please help me to find it...Thankn youVed Prakash Jha |
|
|
vedjha
Posting Yak Master
228 Posts |
Posted - 2009-11-04 : 02:02:43
|
| help me to sortout downlineVed Prakash Jha |
 |
|
|
vedjha
Posting Yak Master
228 Posts |
Posted - 2009-11-04 : 08:52:54
|
| please helpVed Prakash Jha |
 |
|
|
vedjha
Posting Yak Master
228 Posts |
Posted - 2009-11-04 : 12:30:38
|
| help me to sortout downlineVed Prakash Jha |
 |
|
|
|
|
|
|
|