⬅︎ Back to Sorting transform function in PostgreSQL
No need to put it in the results:SELECT id, identifier,FROM questionsWHERE section=123ORDER BY SUBSTRING(identifier FROM '[0-9]{1,2}')::INT, identifier
Comment
No need to put it in the results:
SELECT id, identifier,
FROM questions
WHERE section=123
ORDER BY SUBSTRING(identifier FROM '[0-9]{1,2}')::INT, identifier