-
☆ A M B ☆
- 2,475 Posts
I think this must be a fairly common situation: you want to sort your collection in DESC order, but you don’t want the empty results to show up first... you instead want them to show up last. Is there any way to do that with xPDO? I’m struggling to think of a way to do it in MySQL...
Plan B is just live with it and open up a search form.
-
MODX Staff
- 730 Posts
Not sure what you mean by empty results?
-
MODX Staff
- 730 Posts
Here’s an example of straight SQL to do it:
SELECT `key`, `value`
FROM `modx_system_settings`
ORDER BY IF(`value` IS NULL OR `value` = '', 1, 0), `value`
-
MODX Staff
- 730 Posts