Created
September 16, 2019 12:27
-
-
Save KaiCMueller/f44db07e1982b452b9a577665975529f to your computer and use it in GitHub Desktop.
Doctrine: Order by NULL values first
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$queryBuilder | |
->addSelect("(CASE WHEN entity.placedDate IS NULL THEN 1 ELSE 0 END) AS HIDDEN PLACED") | |
->orderBy('PLACED', 'DESC') | |
->addOrderBy('entity.placedDate', 'DESC'); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment