-1
SELECT * FROM test_table WHERE name='Süleyman';

enter image description here

Result :

With my Query, I want to return only the row having name="Süleyman", But MySQL is returning name="Suleyman" rows too!
Why is this happening and how can I solve it?

DjaouadNM
  • 22,013
  • 4
  • 33
  • 55
  • Seems like a collation issue. The comparison is done according to a collation that treats `ü` as `u`, typically any language except German. Check your language/locale settings. – jarlh Sep 01 '17 at 09:18

1 Answers1

0

Try this

SELECT * FROM test_table WHERE name='Süleyman' COLLATE utf8_bin;

You can see a SQL fiddle here http://sqlfiddle.com/#!9/508b5d/2/0

ice 13
  • 333
  • 4
  • 17
  • This Command work successfully but in My Table options Charracter set is :utf8--UTF-8 unicode and collation utf8_general_ci? – creativedirektor Sep 01 '17 at 09:27
  • Indeed, in those character sets there is a mapping for special characters when performing queries: https://dev.mysql.com/doc/refman/5.7/en/charset-unicode-sets.html . You can however append the above statement to queries for making exception and you should be fine. – ice 13 Sep 01 '17 at 09:33
  • I must create every specific characters column with Collation utf8_bin, than not necessary with command, Thank you very much "ice 13" – creativedirektor Sep 01 '17 at 09:46
  • Now have another problem, not return value when i 'name=süleyman' (lowercase) write? – creativedirektor Sep 01 '17 at 09:59
  • 1
    SOLVED with latin_1 – creativedirektor Sep 01 '17 at 10:09