Created
February 27, 2017 07:18
-
-
Save hr-sadooghi/422d6c795dc83ee5422f9ba709eb34f3 to your computer and use it in GitHub Desktop.
fix-arabic-char-inside-string
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --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