Why some emojis in SQL Server are equal?

巧了我就是萌 提交于 2019-12-11 08:06:32

问题


I using SQL Server 2016 and have one database with Arabic_100_CI_AS and I inserted apple emojis to my database but some of emojis are equals in condtions but other emojis are not equal

select 1
where N'⛑' = N'✅'

or

select 1
where N'✊' = N'⭐️'

This emojis are equals:

✊ ✋ ⛑ ⭐️ ✨ ⛅️ ⛈ ⛄️ ⚽️ ⚾️ ⛳️ ⛸ ⛷ ⛹️ ⛵️ ⛴ ⛽️ ⛲️ ⛱ ⛰ ⛺ ⛪️ ⛩ ⏱ ⏲ ⏰ ⏳ ⛏ ⛓ ⛎ ❌ ⭕️ ⛔️ ❗️ ❕ ❓ ❔ ✅ ❎ ⏸ ⏯ ⏹ ⏺ ⏭ ⏮ ⏩ ⏪ ⏫ ⏬ ➕ ➖ ➗ ➰ ➿ ⬛️ ⬜️


回答1:


As Mr. Martin Smith suggest try to collate them with help of Arabic, binary sort

select 1
where N'⛑' = N'✅' collate Arabic_BIN

or

select 1
where N'✊' = N'⭐️' collate Arabic_BIN

To answer your question : The equality of your emojis are dependent on collation.



来源:https://stackoverflow.com/questions/48194048/why-some-emojis-in-sql-server-are-equal

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!