Group By through ROUND function does not working with oracle database. #6597

Open
opened 2026-01-22 15:35:30 +01:00 by admin · 2 comments
Owner

Originally created by @rajeev-gvr on GitHub (Dec 25, 2020).

Group By through ROUND function does not working in oracle.

Originally created by @rajeev-gvr on GitHub (Dec 25, 2020). Group By through ROUND function does not working in oracle.
Author
Owner

@beberlei commented on GitHub (Dec 25, 2020):

Please add example query and explain how it would need to be in Oracle to work

@beberlei commented on GitHub (Dec 25, 2020): Please add example query and explain how it would need to be in Oracle to work
Author
Owner

@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();

Thank you
@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(); Thank you
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#6597