classAmbiguousAlias
final class AmbiguousAlias
implements Resolution, Diagnostic
uses Snapshot
Public API: explicitly declared with
@visibility public.A name that no column of the position has and that several different select list items carry as their alias; none is chosen.
MySQL reports such a name with ER_NON_UNIQ_ERROR ("Column '%s' in %s is
- ambiguous"); items that compute the same expression under the same alias
do not make a name ambiguous. Source: https://dev.mysql.com/doc/refman/8.4/en/problems-with-alias.html.
(new \SqlSemantics\Platform\MySql\Semantics())->analyze('SELECT 1 AS x, 2 AS x ORDER BY x + 1', []) // throws \SqlSemantics\Platform\MySql\Model\Diagnostic\SemanticException: Column x is ambiguous.new \SqlSemantics\Platform\MySql\Statement\Name\AmbiguousAlias(new \SqlSemantics\Platform\MySql\Model\Statement\Identifier\Name('x'), []) // throws \SqlSemantics\Platform\MySql\Model\Diagnostic\InvalidConstructionProperties§
public list<Field> $candidatespublic Name $nameMethods§
Parameters
Calls 2
- static-call Check::listOf() line 43
- class-const Field::class() line 43
public function message(): stringTest cases 4§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.