[Property name] matches the element containing the given property[Att=value] matches the element containing the given attribute (case sensitive)[Att*=value] Fuzzy matching[Att!=value] cannot be this value[Att$=value] End is this value[Att^=value] starts with this value[ATT1] [ATT2] [Att3] ... Match one of the multiple attribute conditions=========================================== below for example ========
SQL like usage fuzzy query and SQL fuzzy query
Fuzzy query:
References: http://www.w3school.com.cn/ SQL/SQL _wildcards.asp
When searching for data in a database, you can use the
Fuzzy query and SQL fuzzy query
Public function Index () {// fuzzy query by account, real name, and mobile phone number $ user = M ('cuser'); $ where = "(IFNULL (projectno ,'". session ("user") ['projectno']. "') = '". session ("user") ['projectno']. "'OR projectno ='') "; if (! Empty (I ('Param. name ') {$ name = trim
zipcode where (address like '%" zipcode_key "%') or (city like '%" zipcode_key "% ') or (province like '% " zipcode_key " %') order by province, city, address"
Details:
General fuzzy query statement:
SELECT field FROM table WHERE a field Like Condition
SQL provides four matching modes for conditions:
1, %: represents any 0 or multiple characters. It can match
. The following query string is I wrote before, according to the variable Zipcode_key in the Postcode table ZipCode query the corresponding data, this sentence is to judge the variable Zipcode_key as a non-numeric query, with% to match any length of the string, from the table address, city, The three columns of the province query all data items that contain keywords, sorted by province, city, and address. This is a simple example, as long as you under
SQL Fuzzy QueryIn the database query, there is a complete query and fuzzy query points.General Fuzzy query statements are as follows:
SELECT field from table WHERE a field like condition
With regard to the conditions, SQL provides four matching mod
Tags: href ref color database type where Web word searchSQL Fuzzy QueryIn the database query, there is a complete query and fuzzy query points.General Fuzzy query statements are as follows:
SELECT field from table WHERE a field like condition
With regard to the conditions, SQL provides four
In the database query, there is a complete query and fuzzy query points.General Fuzzy query statements are as follows:
SELECT field from table WHERE a field like condition
With regard to the conditions, SQL provides four matching modes:1,%: Represents any 0 or more characters. Can match any t
VALUES (3, ' Harry ', 1) insertintostudentvalues (4, ' Zhao Liu ', 1) insertinto studentvalues (5, ' Sun Seven ', 1)--exact match, whether it is a single value or multi-value, is very good processing select*fromstudentwhere Snamein (' Zhang San ', ' John Doe ')--good handling of single-valued ambiguity select*fromstudentwheresname like '% five '-multi-value fuzzy matching, there is no such a direct-so-call
data in zipcode of the zip code table. The query statement is used to determine that the zipcode_key variable is not a number, use % to match strings of any length, query all data items containing keywords from the address, city, and province columns in the table, and sort by province, city, and address. This example is relatively simple. As long as you understand the method, you can write more complex query statements.
In the database query, there is a complete query and fuzzy query points.General Fuzzy query statements are as follows:
SELECT field from table WHERE a field like condition
With regard to the conditions, SQL provides four matching modes:1,%: Represents any 0 or more characters. Can match any t
General Fuzzy query statements are as follows:
Copy Code code as follows:
SELECT field from table WHERE a field like condition
With regard to conditions, SQL provides four matching modes:
1,%: Represents any 0 or more characters. Can match any type and length of characters, in some cases in Chinese, please use two percent sign (%).
For
SQL fuzzy query
Complete and fuzzy queries are available for database queries.
The general fuzzy query statement is as follows:
Select field from table where a field like Condition
SQL provides four matching modes for conditions:
1, %: Represents any 0 or mul
Tags: using a single character condition log database query Query parser requires process aboutThis article is reproduced from: Original Address link: http://www.cnblogs.com/GT_Andy/archive/2009/12/25/1921914.html In the database query, there is a complete query and fuzzy query points.General Fuzzy query statements are as follows:
SELECT field from table WHERE a field like condition
groupedSuch as:-The total number of girls and boys receivedSelect Sex,count (*) from Student GROUP by sexOrder of Query statements:Select from where the group by has an order byNote: Where is the filter for the source data. It can only use columns that are referred to in the table following the fromAn aggregate function cannot be used after a where condition, and an error will be made if usedHavingIf you are filtering the result set after grouping, then you need to have a having, because the wh
Tags: Wildcard time example log action single quote use Cape includesReprint: http://new-restart.iteye.com/blog/1416765 SQL like wildcard character fuzzy query techniques and special charactersSQL like wildcard character fuzzy query techniques and special characters How to deal with time query by 1,sql like There are s
Tags: RAC single quotation mark contains Val data dash ast AC wildcardTransfer from http://new-restart.iteye.com/blog/1416765SQL like wildcard character fuzzy query techniques and special charactersHow to deal with time query by 1,sql likeThere are savetime (smalldatetime type) fields in the SQL data table with two records in the table with Savetime values: 2005-
The general fuzzy query statement is as follows:
Copy codeThe Code is as follows:SELECT field FROM table WHERE a field Like Condition
SQL provides four matching modes for conditions:
1, %: represents any 0 or multiple characters. It can match any type and length of characters. In some cases, if it is Chinese, use two percent signs (%.
For example, SELECT * FROM [
The general fuzzy query statement is as follows:
Copy codeThe Code is as follows: SELECT field FROM table WHERE a field Like Condition
SQL provides four matching modes for conditions:
1, %: represents any 0 or multiple characters. It can match any type and length of characters. In some cases, if it is Chinese, use two percent signs (%.
For example, SELECT * FROM
This article introduces in detail the usage of LIKE fuzzy query and REGEXP in SQL and some usage of special characters. For more information, see.
This article introduces in detail the usage of LIKE fuzzy query and REGEXP in SQL and some usage of special characters. For more information, see.
When searching for data
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.