Advertisement
Guest User

Untitled

a guest
Feb 17th, 2020
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.45 KB | None | 0 0
  1. <?php
  2.  
  3. ->leftJoin(
  4.     CarOdometerRecord::class,
  5.     'newerCarOdometerRecord',
  6.     Join::WITH,
  7.     $qb->expr()->andX(
  8.         'carOdometerRecord.car = newerCarOdometerRecord.car',
  9.         'EXTRACT( YEAR_MONTH FROM carOdometerRecord.recordedAt ) = EXTRACT( YEAR_MONTH FROM newerCarOdometerRecord.recordedAt )',
  10.         'carOdometerRecord.recordedAt < newerCarOdometerRecord.recordedAt',
  11.     )
  12. )
  13. ->andWhere('newerCarOdometerRecord.recordedAt IS NULL')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement