How to output to same line with relation information same table? This is my current SQL Server query and almost what I want to do:

select "dokumentgruppe" + ', ' + convert(varchar(10), dokumentgruppenr) 
    + ', ' + 'Parent:' + convert(varchar(10), parentgruppenr) 
    as "Dokumentgruppe"
from "dbo"."dokumentgruppe"
where aktiv = '1'
order by "Dokumentgruppe"


It gives me this result:


Budsjetter, 29, Parent:0
E-post, 36, Parent:0
Fyllearrester, 40, Parent:38
Inngående, 42, Parent:36
JuksOgFanteri, 38, Parent:0
Legeattester, 39, Parent:38
Ligning, 26, Parent:0
Periodiske regnskapsrapporter, 30, Parent:0
Permanente opplysninger, 23, Parent:0
Produksjon Fakturering, 33, Parent:0
Produksjon Lønn, 32, Parent:0
Produksjon Regnskap, 31, Parent:0


The thing is, I want to show the actual name of the Parentgruppe instead of ParentgruppeID. The Parentgruppe has an ID and a corresponding name to it.

Like this example:

Legeattester, 39, Parent:*JuksOgFanteri
You can get this result by joining the table to itself. 

select c.dokumentgruppe 
    + ', ' + convert(varchar(10), c.dokumentgruppenr) 
    + ', ' + 'Parent:' + isnull(p.dokumentgruppe,'') 
    + ', ' + convert(varchar(10), c.parentgruppenr) 
    as Dokumentgruppe
from dbo.dokumentgruppe as c
  left join dbo.dokumentgruppe as p on c.parentgruppenr=p.dokumentgruppenr
where c.aktiv = '1'
order by c.Dokumentgruppe


This is an adjacency list style heirarchy, you can find a good introduction to them here: Sql Server Bible Sample Chapter 17: Traversing Hierarchies