Home >Database >Mysql Tutorial >如何判断sql字段中存在中文字符?

如何判断sql字段中存在中文字符?

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-07 17:49:161399browse

如何判断sql字段中存在中文字符?

 代码如下 复制代码
declare @t table([Name] nvarchar(10)) insert @t select '好的啊!' insert @t select '12345好的' insert @t select '123' insert @t select 'sdff' select * from @t where PATINDEX('%[吖-座]%',[name])>0 /* Name        ----------  好的啊! 12345好的  (所影响的行数为 2 行)*/

 

Statement:
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