How do I order query results by alphabetic characters before ordering by numerical values in SQL-Server?
I have myTable with aColumn that I would like to query
I found this, which says to try something like:
SELECT * FROM dbo.myTable
WHERE aColumn LIKE '%val'
ORDER BY IF(aColumn RLIKE '^[a-z]', 1, 2), aColumn
however this was for MySQL, which could be the reason why this does not work in SQL-Server. Is there anything like this for SQL-Server with the Regular expression filter? The error message I get for this is:
Msg 156, Level 15, State 1, Line 3
Incorrect syntax near the keyword 'IF'
Msg 102, Level 15, State 1, Line 3
Incorrect syntax near 'RLIKE'
What I would like to see is something like:
Aval
Bval
Cval
1val
2val
rather than
1val
2val
Aval
Bval
Cval