I have many usernames in a mySQL table, like
user user1 user2 user3 user10 user14 user20 user21
When I use an ORDER BY, it comes out, as you might expect, like
user user1 user10 user14 user2 user20
How do I order these names logically?
TIA, Jeff
hi
assuming that the usernames always begin with 'user' you could use this:
ORDER BY (SUBSTR(username,5) + 0)
You should add 0 in order to make MySQL treat is as an integer rather than string.
cheers
Leszek