orderBy title, but remove the word "The" from titles
{% set entries = craft.entries().section('media').orderBy(&quot;(CASE WHEN `title` LIKE 'The %' THEN SUBSTRING(`title`, 5) WHEN `title` LIKE 'A %' THEN SUBSTRING(`title`, 3) ELSE `title` END) asc&quot;).limit(24).all() %}
worked.