final class GroupConcat
    implements SetFunction
    uses Snapshot
Public API: explicitly declared with @visibility public.

A call of GROUP_CONCAT(): the concatenated non-NULL values of a group, with DISTINCT, an ordering and a separator.

Rule: MYSQL-GROUP-CONCAT-001. The arguments of one row are concatenated, the rows in the written order, separated by the separator (a comma by default). The result is a string in the character set of the arguments, binary when one is binary; it is NULL when a group has no non-NULL row. Its length is cut to group_concat_max_len. The grammar of MySQL 8.0 and later accepts OVER, which the server rejects (ER_NOT_SUPPORTED_YET). Terminates: the parts are strict parts. Source: https://dev.mysql.com/doc/refman/8.4/en/aggregate-functions.html#function_group-concat. Status: Implemented.

Typing GROUP_CONCAT()doctest
$query = (new \SqlSemantics\Platform\MySql\Semantics())->analyze("SELECT GROUP_CONCAT(DISTINCT 'a' SEPARATOR ';')");
    [$query->field(0)->type->descriptor->name(), $query->field(0)->nullability] // => ['VARCHAR', \SqlSemantics\Platform\MySql\Model\Statement\Type\Nullability::Nullable]

Properties§

public list<Scalar> $arguments
public list<OrderItem> $order
public bool $distinct = false
public Text|null $separator = null
public Name|WindowSpecification|null $over = null

Methods§

public function __construct(
    list<Scalar> $arguments,
    public bool $distinct = false,
    list<OrderItem> $order = [],
    public Text|null $separator = null,
    public Name|WindowSpecification|null $over = null,
)

Parameters

$argumentslist<Scalar>The concatenated expressions in order; at least one
$distinctboolWhether DISTINCT is written
$orderlist<OrderItem>The ordering of the rows
$separatorText|nullThe separator, when written
$overName|WindowSpecification|nullThe window written after OVER
Calls 3
public function deriveScalar(Derivation $derivation, Environment $environment): ScalarFact
public function render(Output $out): void

Writes the call and its window.

Parameters

$outOutput
Test cases 1
Calls 5

Test cases 5§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 3
Other tests reaching this symbol 2

Relations§

Instantiated in 1
Type checks 1
Type declarations 1