SQLite Fuzzy Lookup (like)

Source: Internet
Author: User
Tags sqlite


Select Userid,username,name,sex,birthday,height,weight,role from Xqhit_users
where UserName like "%yym%" limit offset 0

Name like "%values%" or name like '%values% ' can be.

SELECT * from db.table limit offset 0; Limit fetch 50 Offset skip 0 general paging common

SQL Fuzzy query statementFor SQL Fuzzy queries, using the like comparison word, plus the wildcard characters in SQL, refer to the following: 1. Like ' mc% ' will search for all strings starting with the letter Mc (such as McBadden).  2. Like '%inger ' will search for all strings ending with the letter inger (such as Ringer, Stringer).  3. Like '%en% ' will search all strings containing the letter en in any location (e.g. Bennet, Green, McBadden).  4. Like ' _heryl ' will search for all six-letter names (such as Cheryl, Sheryl) ending with the letter heryl.  5. Like ' [Ck]ars[eo]n ' will search for the following strings: Carsen, Karsen, Carson, and Karson (such as Carson).  6. Like ' [M-z]inger ' will search for all names (such as Ringer) ending with the string inger, starting with any single letter from M to Z.  7, like ' m[^c]% ' will search starts with the letter M, and the second letter is not all names of C (such as Macfeather). The following sentence query string, according to the variable Zipcode_key in the Postal Code table zipcode query the corresponding data, this sentence is the judgment variable Zipcode_key is not a number when the query statement, with% to match any length of string, from the table address, city, All data items that contain keywords are queried in the save three columns and sorted by province, city, and address.  This is a simple example, so you can write more complex query statements as long as you understand the method. sql = "SELECT * from ZipCode where (address like '%" & zipcode_key & "% ') or (city like '%" & Zipcode_key & "% ') or (province like '%" & zipcode_key & "% ') Order by province,city,address

SQLite Fuzzy Lookup (like)

Related Article

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.