Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
  • Case Sensitive MYSQL select query

    • 0
    • 4
    • 1
    • 2
    • 2
    • 0
    • 0
    • 0
    • 9.70k
    Comment on it

    Case Sensitive SQL query

    A select query does not performs case-sensitive query which means if the user name is pravesh, Pravesh, PRAVESH then it will select all users using simple select. Below example of normal mysql select query -

    SELECT * FROM tablename WHERE username=pravesh

    But if you want a query to be case sensitive then you can use BINARY keyword in query-

    SELECT * FROM tablename WHERE BINARY username =pravesh

    this will select only those user that exactly matches with user name pravesh and not Pravesh and PRAVESH.

    In this case "BINARY" keyword is helpful for you to differentiate with cases.

    Hope this will help you Enjoy !!

 2 Comment(s)

Sign In

Sign up using

Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: