How to ignore case-sensitive characters in SQL fuzzy queries

Source: Internet
Author: User
We know that character fields can contain uppercase and lowercase characters. How can we ignore case-insensitive characters in SQL fuzzy queries?
For example, select * From tablename where fieldb like 'a % '. You want to obtain all records starting with 'A' or 'A.
The following explains how to use 'sort sequence ':
* The default value of the system value qsrtseq is * hex;
* The default value of the srtseq parameter in the user profile table is * sysval;
* In strsql and crtsqlxxx, the default srtseq parameter is * job.
Therefore, the default sort Sequence Value of an OS/400 job is * hex, which means that every character in the orders table has
The relative order and weight of each character. For example, the weight of the character 'a' is 'c1 ', and the weight of the character 'a' is '81'. Therefore, any
The Comparison Between 'A' and 'A' is considered to be different. If you want to compare the two to be equivalent to the character 'a' and 'A', you need
Set 'sort sequence 'to * langidshr to the same weight. The setting method is as follows:

1. strsql
2. f13-Service
3. 1. Change the dialog property.
4. Go down to the page and find 'sort sequence and change it to * langidshr
5. Press the Enter key twice.
6. Run an SQL statement, for example:
Select * from file where field1 like 'a % 'or
Select * from file where field1 like 'a %'
7. Check the query results and you will find that all records whose field1 fields start with 'A' and 'A' are searched.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.