?
Solved

how to select text depend on the localization

Posted on 2013-11-12
3
Medium Priority
?
352 Views
Last Modified: 2013-11-17
Hi Experts
i have a table with one column that accept Arabic and English text for example some of the row have Arabic text and other rows have English text, is there any way in SQL or .net to view only Arabic text or the opposite way

thank you
0
Comment
Question by:AZZA-KHAMEES
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 61

Expert Comment

by:mbizup
ID: 39641399
What kind of text appears in this field?  Sentences?  Abbreviations?  ...?

If the data is in sentence form or similar, using complete words, in English you are guaranteed to have at least one vowel (a,e,i,o,u), so you could try select statements like the following.

For English:

SELECT * FROM YourTable 
WHERE YourField LIKE '%a%' OR YourField LIKE '%e%' OR YourField LIKE '%i%' OR YourField LIKE '%o%' OR YourField LIKE '%u%'

Open in new window


And try the opposite to isolate Arabic records:

SELECT * FROM YourTable 
WHERE NOT (YourField LIKE '%a%' OR YourField LIKE '%e%' OR YourField LIKE '%i%' OR YourField LIKE '%o%' OR YourField LIKE '%u%')

Open in new window

0
 
LVL 4

Accepted Solution

by:
rshq earned 2000 total points
ID: 39649019
Hi

  You can use ASCII , LTrim and RTrim function.
  In this code return only arabic column

 
Select  YourColumn from yourtable where 
            ASCII(substring(Ltrim(Rtrim(YourColumn)),1,1))>=194 and ASCII(substring(Ltrim(Rtrim(YourColumn)),1,1))<=246

Open in new window

0
 

Author Closing Comment

by:AZZA-KHAMEES
ID: 39654428
perfect
0

Featured Post

Get MySQL database support online, now!

At Percona’s web store you can order your MySQL database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I'm trying, I really am. But I've seen so many wrong approaches involving date(time) boundaries I despair about my inability to explain it. I've seen quite a few recently that define a non-leap year as 364 days, or 366 days and the list goes on. …
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses
Course of the Month11 days, 20 hours left to enroll

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question