If I understand correctly, everyone Conceptcan have the other Conceptas a parent, and it is set in the field category.
In other words, a Conceptwith at least one child will be referenced at least once in the field category.
, Django - ; , , SELECT * FROM CONCEPTS WHERE CONCEPTS.ID IN (SELECT CATEGORY FROM CONCEPTS); - , Django:
Concept.objects.filter(pk__in=Concept.objects.all().values('category'))
, , Django, ; :
Concept.objects.filter(id__in=list(Concept.objects.all().values('category')))
, - , Oracle 1000 .