How can I make SQL case sensitive string comparison on MySQL?

前端 未结 11 2182
温柔的废话
温柔的废话 2020-11-22 02:45

I have a function that returns five characters with mixed case. If I do a query on this string it will return the value regardless of case.

How can I make MySQL stri

11条回答
  •  隐瞒了意图╮
    2020-11-22 03:16

    No need to changes anything on DB level, just you have to changes in SQL Query it will work.

    Example -

    "SELECT * FROM

    where userId = '" + iv_userId + "' AND password = BINARY '" + iv_password + "'";

    Binary keyword will make case sensitive.

    提交回复
    热议问题