are string matches in MySql normally case insenstive?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • lkrubner@geocities.com

    are string matches in MySql normally case insenstive?

    If I make this query with MySql:

    SELECT * WHERE keyword='urbani sm'

    is the comparison case insensitive? Will MySql return all rows where
    keyword equals both 'urbanism' and 'Urbanism'?

    I searched this using Google Groups, and was suprised that there were
    no entries on this. This seems almost FAQ material.

  • Malcolm Dew-Jones

    #2
    Re: are string matches in MySql normally case insenstive?

    lkrubner@geocit ies.com wrote:
    : If I make this query with MySql:

    : SELECT * WHERE keyword='urbani sm'

    : is the comparison case insensitive? Will MySql return all rows where
    : keyword equals both 'urbanism' and 'Urbanism'?

    : I searched this using Google Groups, and was suprised that there were
    : no entries on this. This seems almost FAQ material.


    A better place than google groups is in the mysql manual.

    The section called "Comparison Operators" says that "...By default, string
    comparisons are not case sensitive...". A quick test at the mysql> prompt
    shows that that is indeed the case.

    I have not checked how one turns off the default to make the comparison
    case sensitive.



    --

    This space not for rent.

    Comment

    • Jerry Stuckle

      #3
      Re: are string matches in MySql normally case insenstive?

      lkrubner@geocit ies.com wrote:[color=blue]
      > If I make this query with MySql:
      >
      > SELECT * WHERE keyword='urbani sm'
      >
      > is the comparison case insensitive? Will MySql return all rows where
      > keyword equals both 'urbanism' and 'Urbanism'?
      >
      > I searched this using Google Groups, and was suprised that there were
      > no entries on this. This seems almost FAQ material.
      >[/color]

      Text columns are case insensitive. If you want case sensitivity, you
      need to make the column BINARY. It's in the manual - if you know what
      you're looking for.

      --
      =============== ===
      Remove the "x" from my email address
      Jerry Stuckle
      JDS Computer Training Corp.
      jstucklex@attgl obal.net
      =============== ===

      Comment

      Working...