0

I have a table with a column in a database table called KeywordText which currently contains text in lower case, e.g. the word global.

However, if I now need to include keywords in title or upper case, these must be distinct from the lower case keywords, so Global is not the same as global.

Typically, a MySQL SELECT * FROM Keyword WHERE KeywordText = 'global' returns two results, i.e. so Global and global.

But can anyone suggest a way to return only Global? I don't think that including LIKE BINARY in the query will help because it will return other unigram or bigram keywords such as Global networking.

Apologies for any duplication of previous questions.

Mr Morgan
  • 2,215
  • 15
  • 48
  • 78
  • There's some information and approaches in the mysql docs: http://dev.mysql.com/doc/refman/5.0/en/case-sensitivity.html – Erik Nov 19 '14 at 14:08

1 Answers1

0

To do a case sensitive query you need to do it Binary so that it compares each byte of information. Example:

SELECT * FROM `table` WHERE BINARY `column` = 'value'
w3shivers
  • 390
  • 4
  • 18