I am new in service now and I don't know yet how to manipulate the data unlike in MySQL and SQL. I just want to know how can I group by the data.
Here is my code to show the data:
var group = new GlideRecord("table");
group.addEncodedQuery('u_active=True');
group.orderBy('u_order_in_services');
group.query();
while (group.next()) {
gs.info(group.group_name);
}
The result is:
Group 1
Group 1
Group 2
Group 2
Group 3
Group 3
Needed result is:
Group 1
Group 2
Group 3