If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > MySQL consider "AAA" and "AAA " same

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-28-10, 23:56
GongXi GongXi is offline
Registered User
 
Join Date: Jun 2004
Posts: 57
Question 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?
Reply With Quote
  #2 (permalink)  
Old 12-29-10, 05:56
r937 r937 is online now
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,534
try using BINARY compare
Code:
SELECT * FROM stock WHERE code = BINARY 'AAA'
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 12-29-10, 06:27
healdem healdem is offline
Jaded Developer
 
Join Date: Nov 2004
Location: out on a limb
Posts: 9,262
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 my Versys or my Tiger 800 let alone the Norton
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On