SQL unique varchar case sensitivity question

后端 未结 3 1044
佛祖请我去吃肉
佛祖请我去吃肉 2020-11-30 04:22

I\'m trying to populate a SQL table with a list of words. The table itself it pretty simple:

CREATE TABLE WORDS(
  ID BIGINT AUTO_INCREMENT, 
  WORD VARCHAR(         


        
3条回答
  •  悲哀的现实
    2020-11-30 04:57

    By default MySQL ignores differences in case and trailing spaces on varchar.

    If you need it to be case sensitive, you can alter the table to be varchar(...) binary.

    Use show create table to better understand how MySQL converts this to full notation.

    If you need to pay attention to trailing spaces as well as be case sensitive, use varbinary instead of varchar.

提交回复
热议问题