Skip to content
Advertisement

Tag: doctrine-orm

Symfony doctrine orderby and group by (distinct)

I am trying to get the latest booked courses (unique). I have tried the following with the Doctrine querybuilder: Without the orderby it works but it will traverse the bookings ascending. I need the latest booked courses. With this query I am getting this error: SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #1 of ORDER BY clause is not

Doctrine 2 Query Builder abs Function

This Work: This Don’t Work: The Error: Syntax Error] line 0, col 118: Error: Expected end of string, got ‘(‘ The native doctrine function abs work only on a select part of statment and don’t work on order by part. Obs: 1-) Im avoiding to use NativeQuery. 2-) u.code is a varchar fild on mysql and need to be varchar

Doing a WHERE .. IN subquery in Doctrine 2

I’d like to select order items from all orders with a specific item. In SQL I’d do it like this: How would I do this query with the query builder? Answer This is how I would try it: I didn’t test this of course, and made some assumptions about your models. Possible problems: Limit: this has been somewhat of a

Advertisement