How do i handle Group Hierarchy?
-
Hi all kindly help me to handle the followings. 1)I have Created a Group Name MasterGroup 2)Created an other Group Name ChildGroup Under MasterGroup 3) Created an other Group Name ChildGroup_A Under ChildGrup Doing like above i have created a Group and under Group hierarchy say up to 6 step deep. Now i have Created some account using group and under group. like:- Id Name UnderGroup 1 abc MasterGroup 2 Bzx ChildGroup 3 Kml ChildGroup 4 Axv ChildGroup_A Up to this there is no problem, But i want to fetch Records group wise. I want result using following sql statements Select * from Tablename where UnderGroup = 'MasterGroup' in response it will show me all records having under group mastergroup and the records having relation with mastergroup. similarly when i use following sql statement Select * from tablename where groupname='Childgroup' in response it will show me only records having the groupname childgroup and records having relation upto Childgroup. I am working in vb2005 and mssql. kindly send me code if posible. a help would be highly appreciated. Thanks rm
rmshah Developer
-
Hi all kindly help me to handle the followings. 1)I have Created a Group Name MasterGroup 2)Created an other Group Name ChildGroup Under MasterGroup 3) Created an other Group Name ChildGroup_A Under ChildGrup Doing like above i have created a Group and under Group hierarchy say up to 6 step deep. Now i have Created some account using group and under group. like:- Id Name UnderGroup 1 abc MasterGroup 2 Bzx ChildGroup 3 Kml ChildGroup 4 Axv ChildGroup_A Up to this there is no problem, But i want to fetch Records group wise. I want result using following sql statements Select * from Tablename where UnderGroup = 'MasterGroup' in response it will show me all records having under group mastergroup and the records having relation with mastergroup. similarly when i use following sql statement Select * from tablename where groupname='Childgroup' in response it will show me only records having the groupname childgroup and records having relation upto Childgroup. I am working in vb2005 and mssql. kindly send me code if posible. a help would be highly appreciated. Thanks rm
rmshah Developer
Firstly it is not very clear what it is that you want to do. Nor is there any mention of what errors or results, if any, you are getting when you try the SQL statements you have shown in your post. However, one thing springs to mind, given that you mention grouping. Have you looked at the GROUP BY clause of SQL?
Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”