The syntax format of the like statement is:
Select * from table name where field name like corresponding value (substring)
It is used to retrieve corresponding substrings in a struct field column.
Assume that there is a database with a table Table1, and Table1 has two fields: name and sex.
Balanced data. Now we want to query records starting with "Zhang" in the name field. The statement is as follows:
Select * From Table1 where name like "sheet *"
To query records ending with "sheets", the statement is as follows:
Select * From Table1 where name like "* Sheets"
The wildcard "*" is used here. It can be said that the like statement is inseparable from the wildcard. Next we will introduce in detail
Wildcard character.
* C * c Represents CC, CBC, CBC, cabdfec, and so on. It is equivalent to the wildcard in the doscommand and represents multiple characters.
% C % indicates that this method, such as agdcagd, is used in many programs, mainly to query the sub-string.
A A represents a *
B? B Represents BRB, BFB, and so on? Wildcard, representing a single character
# K indicates k1k, k8k, k0k, etc.
[A-Z] represents any of the 26 letters from A to Z
Exclude [! Character] [! A-Z] indicates 9, 0, %, *, etc.
Number exclusion [! Number] [! 0-9] indicates a, B, c, d, etc.
Combination Type
Character [range type] character CC [! A-d] # indicates CCF # and can be combined with other methods
// Fuzzy search includes image 2011-01 **
(Ccombobox *) getdlgitem (idc_combo_year)-> getwindowtext (year );
(Ccombobox *) getdlgitem (idc_combo_month)-> getwindowtext (month );
Connect = year + "-" + month;
SQL. Format ("select * From tb_outrecords where startdate like '% S %' and
Basiccode = '% S' ", connect, leavebasiccode );