MySQL Fuzzy query

Source: Internet
Author: User

MySQL Fuzzy query

The variables that appear in double quotes are automatically parsed.
$sql = "SELECT * from oneself WHERE name like '%{$colname _recordset1} ' LIMIT {$startRow _recordset1}, {$maxRows _recordset1} ";
$Recordset 1 = mysql_qu

The variables that appear in double quotes are automatically parsed.
$sql = "SELECT * from oneself WHERE name like '%{$colname _recordset1} ' LIMIT {$startRow _recordset1}, {$maxRows _recordset1} ";
$Recordset 1 = mysql_query ($sql) or Die (Mysql_error ());

{} on either side of the variable directly indicates that it is a variable and the name of the variable,

Query Chinese characters,
SELECT * FROM mytable where mysqlname like "%%"

If the size Word distinguishes query English characters,
SELECT * FROM MyTable where mysqlname like Binary ("%a%")

If all the above conditions are to be
SELECT * FROM mytable where mysqlname like "% not%" and mysqlname like Binary ("%a%")

Select Id,name from depart where name like%?% This is just a fuzzy query for name

I want to make a fuzzy query on the ID, what should I do?

Select Id,name from depart where id like '%123% '

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.