Skip to content

string_join

relationalai.semantics.std.aggregates
string_join(*args: AggValue, sep="", index=1) -> Aggregate

Join string values with a separator.

  • *args

    (AggValue, default: ()) - String values to join.
  • sep

    (, default: "") - Separator string to use between values. Default: empty string.
  • index

    (, default: 1) - Index parameter for ordering. Default: 1.
  • Aggregate - An Aggregate representing the computation of the joined string. Returns String.

Join employee names with comma separator:

>>> select(aggregates.string_join(Employee.name, sep=", "))

Join product tags per category:

>>> select(Category, aggregates.string_join(Product.tag, sep="; ").per(Category).where(Product.category == Category))