Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- ->leftJoin(
- CarOdometerRecord::class,
- 'newerCarOdometerRecord',
- Join::WITH,
- $qb->expr()->andX(
- 'carOdometerRecord.car = newerCarOdometerRecord.car',
- 'EXTRACT( YEAR_MONTH FROM carOdometerRecord.recordedAt ) = EXTRACT( YEAR_MONTH FROM newerCarOdometerRecord.recordedAt )',
- 'carOdometerRecord.recordedAt < newerCarOdometerRecord.recordedAt',
- )
- )
- ->andWhere('newerCarOdometerRecord.recordedAt IS NULL')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement