12

In the SQLite database, I have stored all values in uppercase.

How can I select the specified value in the database using lower case?

xarlymg89
  • 2,552
  • 2
  • 27
  • 41
user533787
  • 689
  • 2
  • 13
  • 28

2 Answers2

16

For anyone else that arrived here from Google looking how to select as upper case in SQLite, as expected, this will work:

sqlite> SELECT UPPER("Hello, WORLD!");
HELLO, WORLD!

https://sqlite.org/lang_corefunc.html#upper

Zombo
  • 1
  • 62
  • 391
  • 407
ban-geoengineering
  • 18,324
  • 27
  • 171
  • 253
13

SQLite has a LOWER function for this:

sqlite> SELECT LOWER("Hello, WORLD!");
hello, world!

The lower(X) function returns a copy of string X with all ASCII characters converted to lower case. The default built-in lower() function works for ASCII characters only. To do case conversions on non-ASCII characters, load the ICU extension.

Mark Rushakoff
  • 249,864
  • 45
  • 407
  • 398