我们如何将阿拉伯名称与 SQL Server 2012 中的列分开? [英] How can we separate arabic names from a column in SQL Server 2012?

查看:26
本文介绍了我们如何将阿拉伯名称与 SQL Server 2012 中的列分开?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在 SQL Server 2012 中将阿拉伯语名称与表的列分开

How to separate the arabic names from the column of a table in SQL Server 2012

我已经输入了一张表格的图像,它有阿拉伯语和英语,我需要将阿拉伯语名称分开,或者我只需要从表格中获取地址的阿拉伯语名称

I have input an image of the table in this it have arabic and English I need to separate the arabic names or I need to take only the arabic name of address from the table

推荐答案

通过使用 like N'%[أ-ي]%' 过滤阿拉伯字符串.

Filter on Arabic strings via using like N'%[أ-ي]%'.

演示:-

Create table #Emp
(id int ,
name nvarchar(100))

insert into #Emp values (1 , 'Ahmed Abdelqader')
insert into #Emp values (2 , N'أحمد عبد القادر')

select * from #Emp
where name like N'%[أ-ي]%'

结果:-

id  name
2   أحمد عبد القادر

更新:-

如果您只需要获取阿拉伯语单词,请使用下一个代码:-

If you need to get the Arabic words ONLY, Use the next code:-

name like N'%[أ-ي]%' and name not like N'%[a-z]%'

这篇关于我们如何将阿拉伯名称与 SQL Server 2012 中的列分开?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆