--Wildcard characters: _,%, [], ^
--_ denotes any single character
Surname Zhang, two words.
SELECT * from mystudent where fname like ' Zhang _ '
--surname Zhang, three words
SELECT * from mystudent where fname like ' Zhang __ '
--% matches any number of arbitrary characters
--regardless of the number of words, as long as the first character is ' Zhang ' on the query out
SELECT * from mystudent where fname like ' sheet% '
SELECT * from mystudent where fname like ' Zhang% ' and Len (fname) =2
--[] indicates the filter, scope.
SELECT * FROM Tblstudent
SELECT * from tblstudent where tsname like ' Zhang [0-9] sister '
SELECT * from tblstudent where tsname like ' Zhang _ Mei '
SELECT * from tblstudent where tsname like ' Zhang [a-z] sister '
SELECT * from tblstudent where tsname like ' Zhang [a-z0-9] sister '
SELECT * from tblstudent where tsname like ' Zhang [^0-9] sister '
SELECT * from Tblstudent where tsname don't like ' Zhang [0-9] sister '
Update tblstudent Set Tsname=replace (Tsname, ' (female) ', ')
--Check out the people whose names contain%
--The wildcard is not considered a wildcard if it is escaped in the [].
SELECT * from tblstudent where tsname like '%[%]% '
--where ColumnA like '%5/%% ' ESCAPE '/'
--Specify an escape character yourself
SELECT * from tblstudent where tsname like '%/]% ' ESCAPE '/'
SELECT * from tblstudent where tsname like '%/[% ' ESCAPE '/'
SELECT * from tblstudent where tsname like '%/[%/]% ' ESCAPE '/'
sqlserver--Fuzzy query-wildcard characters