DarkConsultant
Programmer
Hi All,
I'm trying to build a query but getting nowhere ....
Example Table
UIN group_name subgroup_of etc ...
1 Group1 NULL
2 Group2 NULL
3 SubGroup1 2
4 SubGroup2 1
5 SubGroup3 1
I want the results to be ...
1 Group1 NULL
4 SubGroup2 1
5 SubGroup3 1
3 Group2 NULL
2 SubGroup1 2
but cant find the correct query. Ive tried group by and order by but I either get the groups order correct or the subgroups but not both.
Can anyone help?
Regards
DarkConsultant
Live long and prosper \\//
I'm trying to build a query but getting nowhere ....
Example Table
UIN group_name subgroup_of etc ...
1 Group1 NULL
2 Group2 NULL
3 SubGroup1 2
4 SubGroup2 1
5 SubGroup3 1
I want the results to be ...
1 Group1 NULL
4 SubGroup2 1
5 SubGroup3 1
3 Group2 NULL
2 SubGroup1 2
but cant find the correct query. Ive tried group by and order by but I either get the groups order correct or the subgroups but not both.
Can anyone help?
Regards
DarkConsultant
Live long and prosper \\//