mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
Group By through ROUND function does not working with oracle database. #6597
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @rajeev-gvr on GitHub (Dec 25, 2020).
Group By through ROUND function does not working in oracle.
@beberlei commented on GitHub (Dec 25, 2020):
Please add example query and explain how it would need to be in Oracle to work
@rajeev-gvr commented on GitHub (Dec 25, 2020):
@beberlei Thanks for reply. I have some decimal vales in my db column "total_score". I want to fetch them with the group in rounded values. I tried this way but it doesn't work. Code example given below:
$qb = $this->em->getRepository(SomeEntity::class)->createQueryBuilder('some');
$qb->select(
"some.id",
"Round(some.total_score) as total",
"some.created"
)
->where($qb->expr()->eq("some.id", "?1"))
->setParameter("1", 41)
->groupBy("Round(some.total_score)")
->orderBy("some.created")
->getQuery()
->getResult();