DDC-3720: Doctrine - Invalid column name 'sclr0' #4567

Open
opened 2026-01-22 14:45:02 +01:00 by admin · 1 comment
Owner

Originally created by @doctrinebot on GitHub (Apr 29, 2015).

Originally assigned to: @guilhermeblanco on GitHub.

Jira issue originally created by user Belita Colares:

My query doesn't work when i use ->setMaxResult with orderBy SUM.

My dataBase is MSSQL SERVER 2008 R2

$query = $entity->createQueryBuilder('t')
                        ->select('SUM(t.price) AS test')
                        ->setMaxResults(10)
 ->orderBy('test', 'ASC')->getQuery()->getResult();

when i use only
'->select('t.price AS test') ->setMaxResults(10) ->orderBy('test', 'ASC');' doesn't work too

Invalid column name 'sclr0'.
but when i comment this method setMaxResult() my query works fine.

Please help-me, I sorry my english.

Originally created by @doctrinebot on GitHub (Apr 29, 2015). Originally assigned to: @guilhermeblanco on GitHub. Jira issue originally created by user Belita Colares: My query doesn't work when i use ->setMaxResult with orderBy SUM. My dataBase is MSSQL SERVER 2008 R2 ``` $query = $entity->createQueryBuilder('t') ->select('SUM(t.price) AS test') ->setMaxResults(10) ->orderBy('test', 'ASC')->getQuery()->getResult(); ``` when i use only '->select('t.price AS test') ->setMaxResults(10) ->orderBy('test', 'ASC');' doesn't work too Invalid column name 'sclr0'. but when i comment this method setMaxResult() my query works fine. Please help-me, I sorry my english.
Author
Owner

@doctrinebot commented on GitHub (Nov 15, 2015):

Comment created by ilijatovilo:

I'm having the same issue. I'd really appreciate some feedback on this issue.

Can you reproduce? Is it worked on?

@doctrinebot commented on GitHub (Nov 15, 2015): Comment created by ilijatovilo: I'm having the same issue. I'd really appreciate some feedback on this issue. Can you reproduce? Is it worked on?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#4567