Home Database Mysql Tutorial MySQL Like语句的使用方法_MySQL

MySQL Like语句的使用方法_MySQL

Jun 01, 2016 pm 01:25 PM
English

bitsCN.com

REGEXP
例1.查询字段中包含非英文的数据

SELECT *
FROM `m_user`
WHERE `emp_no`
REGEXP '[^ -~]' =1
 
列2.这样能把所有不含英文的都搞出来

SELECT *
FROM table
WHERE name
NOT REGEXP '[a-zA-Z0-9]+'

当然除了regexp之外还可以使用FIND_IN_SET,like来操作
FIND_IN_SET
mysql中如何使用FIND_IN_SET(),以及使用FIND_IN_SET()注意的地方,还有F第二世界整理发布IND_IN_SET()与in()的使用区别。
在mysql中查询表字段 pingid = (1,2,3,)

SELECT * FROM `linkinfo` WHERE `pingid` REGEXP '{id},' AND `pingid` NOT REGEXP '[[:alnum:]]+{id},' 

使用上面的语句,可以查询出来

Like
MySQL中,SQL的模式缺省是忽略大小写的。下面显示一些例子。注意在你使用SQL模式时,你不能使用=或!=;而使用LIKE或NOT LIKE比较操作符。
SELECT 字段 FROM 表 WHERE 某字段 Like 条件
其中关于条件,SQL提供了四种匹配模式:
1,%:表示任意个或多个字符。可匹配任意类型和长度的字符。
比如
代码如下 复制代码
SELECT * FROM [user] WHERE u_name LIKE ‘%三%'

bitsCN.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to change Google Chrome to Chinese mode? How to change Google Chrome to Chinese mode? Mar 13, 2024 pm 07:31 PM

How to change Chinese to English in Google Chrome? Some friends want to set Google Chrome to English so that they can continuously improve their English during use. So how to set it to English? Google Chrome is Chinese by default. Below, I will show you how to set the language of Google Chrome to English. Let’s take a look. Setting steps: 1. Open [Google Chrome], as shown in the figure below. 2. Click the [three dots] menu in the upper right corner of the Google Chrome interface, as shown in the figure below. 3. After entering the menu page, find [Settings], as shown in the figure below. 4. After entering the settings page, click the [Language] option, as shown in the figure below. 5. Select [Add Language] in the language interface, as shown in the figure below.

How to solve the problem of English appearing when booting up Windows 10 computer How to solve the problem of English appearing when booting up Windows 10 computer Jul 11, 2023 pm 04:57 PM

Many friends always encounter various problems when using computers. For example, after turning on the computer, they find that the entire computer has changed to English. Many friends do not know how to set it back to Chinese. The editor below will teach you how to set up a win10 computer. How to solve the problem of English appearing when turning on the computer. 1. After turning on the computer, click "Start - Settings" in the lower left corner. As shown in the figure: 2. After entering the Windows settings interface, click "Time and Language". As shown in the figure: 3. After entering the time and language interface, click "Region and Language". As shown in the figure: 4. After entering the region and language interface, click "Manage Language Settings". As shown in the figure: 5. After entering the management interface, click "Copy Settings". As shown in the figure: 6. Enter the welcome screen settings

How to hide the English keyboard in Win11 How to hide the English keyboard in Win11 Jan 03, 2024 pm 09:45 PM

Some friends do not need to use the English keyboard, but only need to use the Chinese keyboard. At this time, they will find the English keyboard very troublesome and want to hide it. However, we cannot hide it, but we can directly delete the English input method. Let’s follow the editor. Take a look. How to hide the English keyboard in win11 1. The English keyboard cannot be hidden, but we can delete it directly in the input method. 2. First enter "Settings" through the start menu 3. Then select "Time & Language" 4. Then enter "Language & Region" and click "Addakeyboard" below to add keyboard shortcuts. 5. Then click on the input method we want, and then click the arrow in the lower left corner to move it to

How to fix the input method that comes with Windows 10 to English How to fix the input method that comes with Windows 10 to English Jan 15, 2024 pm 01:48 PM

Many friends who work on the computer use the English input method to work. At this time, they need to lock the English input. So how to lock it? Let’s take a look at the detailed methods below. How to lock the input method that comes with win10 in English: 1. Click the input method logo in the lower right corner of the desktop, and then click "Language Preferences". 2. Then click "Add preferred language" under the preferred language. 3. Enter English in the dialog box and click to install the language. 4. After the installation is complete, click "Set as default language".

How to set the language of Windows 10 Home Edition to English How to set the language of Windows 10 Home Edition to English Feb 14, 2024 pm 07:36 PM

In the Windows operating system, we can easily enable various languages ​​to facilitate system display, thereby further enhancing user experience and communication efficiency. Open the system settings interface, then select the "Input method and keyboard" option, and then click to add the selected language in this interface. How to set the Windows 10 Home Edition language to English 1. Click Start to enter Settings 2. Click to enter Time and Language 3. Select "Region and Language", then click "Add Language" 4. Select English (unitedstates)

How to solve the problem of English display of Win10 computer icons How to solve the problem of English display of Win10 computer icons Dec 23, 2023 pm 09:59 PM

Many users find that when using computers, all the icons on their computer screens have become English, and even the menus have become English. We only need to modify the system default language. If that doesn't work, change the region. What should I do if win10 displays that my computer icon has changed to English? Solution: 1. Open Settings from the Start menu, and then select. 2. Then in, select and click below. 3. If the above operation does not solve the problem, we can change it from the control panel.

Implementation plan sharing for converting months into English in PHP programming Implementation plan sharing for converting months into English in PHP programming Mar 22, 2024 am 08:24 AM

Months often need to be converted to English in PHP programming. This is especially common in some projects, such as generating monthly reports, displaying calendars, etc. Let's share an implementation plan to demonstrate how to convert months to English through specific code examples. In PHP, month conversion can be achieved by establishing a mapping relationship between the number of the month and the corresponding English name. First, you can define an array containing the English names of all months, and then find the corresponding English names in the array based on the month numbers. //Define an array containing the English name of the month

PHP programming skills: dealing with English writing problems PHP programming skills: dealing with English writing problems Mar 06, 2024 pm 06:06 PM

PHP Programming Tips: Dealing with Problems Written in English PHP is a powerful server-side scripting language that is widely used in the field of web development. In the process of PHP programming, we often encounter the problem of processing English writing, especially when processing file IO operations or database operations. This article will explore how to deal with English writing issues in PHP and provide specific code examples. 1. Unicode encoding issues When dealing with English writing issues, you must first understand Unicode encoding. Unicode is a word

See all articles