Skip to content

Instantly share code, notes, and snippets.

@hr-sadooghi
Created February 27, 2017 07:18
Show Gist options
  • Save hr-sadooghi/422d6c795dc83ee5422f9ba709eb34f3 to your computer and use it in GitHub Desktop.
Save hr-sadooghi/422d6c795dc83ee5422f9ba709eb34f3 to your computer and use it in GitHub Desktop.
fix-arabic-char-inside-string
--fix
UPDATE post SET body = replace(body, 'ي', 'ی') WHERE body LIKE '%ي%';
--fix
UPDATE post SET body = replace(body, 'ك', 'ک') WHERE body LIKE '%ك%';
--find how many post has arabic 'ي'
select count(*) from post where body like '%ي%';
--find how many post has arabic 'ك'
select count(*) from post where body like '%ك%';
--find how many post has a arabic 'ي' or 'ك'
select count(*) from post where body like '%ي%' OR body like '%ك%';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment