Case Insensitive Java DB Search (Derby)

I am using Derby and I cannot find a way to make case insensitive.

For example, I have a table that I am looking for that contains β€œHello”, but I set a search query for β€œHello”, and at the moment I will not get the result, but I want to.

I can not find the correct syntax for it.

Sarah

+6
source share
2 answers

You can use the UPPER () or LOWER () SQL functions for both your search argument and the field, for example, in

SELECT * FROM mytab WHERE UPPER(lastname) = UPPER('McDonalds') 
+8
source

The most common way to do this is to use the created columns. Here's a good entry from one of the Derby developers: http://blogs.oracle.com/kah/entry/derby_10_5_preview_generated

+4
source

Source: https://habr.com/ru/post/888717/


All Articles