Replace and regexp usage0 Comments | This entry was posted on Apr 08 2010.
Mysql replace usage
1. replace
Replace into table (id, name) values ('1', 'A'), ('2', 'bb ')
This statement inserts two records into the table. If the primary key id is 1 or 2
Use of Replace and regexp0 Comments | This entry is posted on APR 08 2010
MySQL Replace usage
1.replace into
Replace into table (Id,name) VALUES (' 1′, ' AA '), (' 2′, ' BB ')
The purpose of this statement is to insert two records into table tables.
Before starting this topic, we should first conduct a small experiment to compare the high efficiency of REGEXP and Like. If the efficiency is too low, we do not need to do too much research, the experiment code is as follows:Require ("config. php ")
Use REGEXP Regular Expressions in MySQL.
In the past, I used like to search for data. Later I found that mysql also had regular expressions and felt better than like. Next I will share with you the Usage Details of mysql REGEXP regular expressions,
MySQL field values are replaced by the following practices:
The code is as follows
Copy Code
Update ' Table_hospital ' Set service=replace (service, "", "")
Can limit the ID, scope, specific content to play
I used to find the data are using like later found in MySQL also have regular expressions and feel better than like, I would like to share with you the MySQL regexp regular expression use of detailed, I hope this method is helpful.
MySQL is
Before we start this topic we first do a small experiment, compare regexp and like them two which is high efficiency, if the efficiency is too low, we do not need to do too much research, the experiment code is as follows:Require
I used to look for data are using like later found that there are regular expressions in MySQL and feel better than like, let me share with you the MySQL regexp regular expression using a detailed, I hope this method is helpful to everyone.A regular
I often talk about the usage of MYSQL pattern matching REGEXP and like, mysqlregexp
Like
LikeThe whole data must be matched, while REGEXP only needs to be partially matched.That is to say, to use Like, all content of this field must meet the
Mysql fuzzy query like and REGEXP Usage Details, fuzzy query regexp
Preface
In mysql, like and regexp are implemented for Fuzzy queries. This article describes how to use these two methods in detail through the instance code. Let's learn from them
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.