Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2004
    Posts
    57

    Question Unanswered: MySQL consider "AAA" and "AAA " same

    Hi,

    I recently facing a problem, i have 2 record in my table, one with code = "AAA" and one with code = "AAA ". When i issue query
    select * from stock where code = "AAA";
    Mysql return 2 record to me, how to set this 2 records as different record?

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    try using BINARY compare
    Code:
    SELECT * FROM stock WHERE code = BINARY 'AAA'
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    or better yet fix the data so it doesn't happen
    and even better fix the design or the application so it cannot happen again
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •