0
votes

I need a numeric alias in Select in DQL: SELECT c.id, dsv63.name AS 102
But after that I get an error:

[Syntax Error] line 0, col 423: Error: Expected Doctrine\ORM\Query\Lexer::T_FROM, got '102'

1

1 Answers

0
votes

It isn't a Doctrine2 problem, you can't use integers as names in MySQL.

There are reserved names for tables too, for example, you can't name your table where like SELECT * FROM foo AS where will throw you an exception.

What you can do, is prepend a character, for example

SELECT c.id, dsv63.name AS _102

Or quote it

SELECT c.id, dsv64.name AS '102'