Fuzzy query in Database

Source: Internet
Author: User
Tags strfind
For Fuzzy queries in databases, use * or? Replace the corresponding characters in the word to perform fuzzy search. * matching characters can be replaced by % in the database ;? The critical character can be replaced by _ In the database. instance code: CStringstrFind; m_Rich.GetWindowText (strFind); strFind. Replace (*, %); strF

For Fuzzy queries in databases, use * or? Replace the corresponding characters in the word to fuzzy query. "*" matching characters can be replaced by "%" in the database ;"? "The critical character can be replaced by" _ "in the database. instance code: CString strFind = ""; m_Rich.GetWindowText (strFind); strFind. replace ("*", "%"); strF

Fuzzy search

Fuzzy query in the database, using "*" or "?" Replace the corresponding characters in the word to fuzzy query. "*" matching characters can be replaced by "%" in the database ;"? "The critical character can be replaced by" _ "in the database.

Instance code:

CString strFind = "";
M_Rich.GetWindowText (strFind );
StrFind. Replace ("*", "% ");
StrFind. Replace ("? ","_");
CString strSQL = "";
StrSQL. format ("select. keycode as keycode,. codeno as keycodeno, B. codevalue as codevalue, B. codeno as codeno from keycount as a, codevalue as B where. keycode like '% s' and. relaxno = B. ID order by. keycode,. id ", strFind );
BOOL bExcute = ExcuteDBSQL (strSQL );

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.