How to ignore case in the query

Like the title.Can we do that with the cluster settings?Or something else?

Hey @edgar,

Unfortunately, there is no current cluster setting that can be modified to alter case sensitivity. However, can you provide some of the details of the query you are having an issue with, specifically so we can take a look at determining what factor may be at play? We may be able to recommend some kind of workaround based on that info.

Cheers,
Ricardo

Hey,@rickrock
That’s very simple query.Just like this:

select * from tb where col_no='EBS203402';

The col_no column’s content stored by itself ,some of it is uppercase,and else is lowercase.But the fact is we don’t know whick NO. is uppercase and which is lowercase.So what we should do before get the right result.

Hey @edgar,

Since string variables in CockroachDB are case-sensitive, you can use ILIKE in your query to perform the check using case insensitivity, as its mentioned here in the docs. Using your example query above:

SELECT * FROM tb WHERE col_no ILIKE 'ebs203402';

As long as all these individual strings are in the database, then the query should return ‘ebs203402’, ‘EBS203402’, ‘Ebs203402’, … and so on. Let me know if that is what you are looking for, or if you have any other questions.

Cheers,
Ricardo

@rickrock

Amazing .That.s what I am looking for.Appreciate that.