I'm trying to use this query, to filter between the names C89 to C110.
SELECT id FROM servers WHERE server_name BETWEEN 'C89' AND 'C110'
But this doesn't work. If I change c89 to c90, it at least selects the two servers. It's like it's only using the first 2 numbers in the calculation.
Can anyone help me ? I'm using mariadb 10.5 I'm looking for a solution that doesn't need to add a lot of words into the query. To be as lean as possible for readability
where server_name like 'C%' and cast(substring(server_name,2) as number) between 89 and 110
. The actual functions you use would depend on your unknown RDBMS.C89
toC089
. After this BETWEEN will act as needed.