sql - MySQL case-insensitive DISTINCT -


can tell me how can select distinct database without being case-sensitive?

my query

select distinct email `jm_order` 

the results brings out emails in table repeats ones different cases e.g

sam@gmail.com josh@gmail.com sam@gmail.com john@gmail.com 

what adjustment can make sql stop repeating sam@gmail.com because different cases?

try use upper function

select distinct upper(email) `jm_order` 

you can use lower instead

select distinct lower(email) `jm_order` 

more information.


Comments

Popular posts from this blog

php - get table cell data from and place a copy in another table -

javascript - Mootools wait with Fx.Morph start -

php - Navigate throught databse rows -