MySQL LIKE clause

法:SELECT * from user WHERE name LIKE '%o%';

Where user name is the name for the table header o query data

PS  SQL using the LIKE clause percent sign  % character to represent any character, similar to the UNIX regular expression or asterisk  *. If you do not use a percent sign  %, LIKE clause and the equal sign  = the effect is the same

'% a' // at the end of the data a '% a' // begin with a data '% a%' // contains a data     
    

Guess you like

Origin www.cnblogs.com/zhufangyuan09/p/10950791.html