UNGROUP

UNGROUP( recordset [, UNORDERED | ORDERED( bool ) ] [, STABLE | UNSTABLE ] [, PARALLEL [ ( numthreads ) ] ] [, ALGORITHM( name ) ] )

recordsetThe set of previously GROUPed records.
UNORDEREDOptional. Specifies the output record order is not significant.
ORDEREDSpecifies the significance of the output record order.
boolWhen False, specifies the output record order is not significant. When True, specifies the default output record order.
STABLEOptional. Specifies the input record order is significant.
UNSTABLEOptional. Specifies the input record order is not significant.
PARALLELOptional. Try to evaluate this activity in parallel.
numthreadsOptional. Try to evaluate this activity using numthreads threads.
ALGORITHMOptional. Override the algorithm used for this activity.
nameThe algorithm to use for this activity. Must be from the list of supported algorithms for the SORT function's STABLE and UNSTABLE options.
Return:UNGROUP returns a record set.

The UNGROUP function removes previous grouping. This is equivalent to using the GROUP function without a second parameter.

Example:

  MyRec := RECORD
  STRING20 Last;
  STRING20 First;
  END;
  
  SortedSet := SORT(Person,Person.last_name); //sort by last
          name
  GroupedSet := GROUP(SortedSet,last_name); //then group
          them
  
  SecondSort := SORT(GroupedSet,Person.first_name);
  //sorts by first name within each last name group
  // this is a "sort within group"
  
  UnGroupedSet := UNGROUP(GroupedSet); //ungroup the
          dataset

See Also: GROUP