Question

is there any way how to sort the result set in GT.M by specific value?

Let's say I have global variable ^People(name,surname)=age and I want to get all the people with age between 20 and 40, ordered by their age?

Was it helpful?

Solution

Edit: Sorry to Answer instead of continuing the comment chain... my permissions level isn't high enough to comment on this question yet.

As long as you won't have multiple people with the same name, but different surnames, Yogesh is correct. It would be best to use the index to find the correct node of ^People, then grab what you need from ^People. But if you would have multiple people with the same name, but a different surname, then you would want to include the surname in the ^PeopleAgeIndex subnodes.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top