sql - Order strings case-insensitively in MySQL -
sql - Order strings case-insensitively in MySQL -
how can order username
column values irrespective of case sensitive in mysql rdbms?
table construction , info :
class="lang-none prettyprint-override">╔══════╦════════════╦════════╗ ║ id ║ username ║ name ║ ╠══════╬════════════╬════════╣ ║ 1 ║ adam ║ test ║ ║ 2 ║ ben ║ test1 ║ ║ 3 ║ aron ║ test2 ║ ║ 4 ║ charles ║ test3 ║ ╚══════╩════════════╩════════╝
desired result :
class="lang-none prettyprint-override">╔══════╦════════════╗ ║ id ║ username ║ ╠══════╬════════════╣ ║ 1 ║ adam ║ ║ 2 ║ aron ║ ║ 3 ║ ben ║ ║ 4 ║ charles ║ ╚══════╩════════════╝
you can format username
upper or lower case in order by
clause follows:
order lower(username)
mysql sql sql-order-by case-insensitive
Comments
Post a Comment