MySQL Forums
Forum List  »  Newbie

BINARY Comparison
Posted by: Daniel Tschinder
Date: June 14, 2005 02:57PM

I have a Homepage that uses PHP und mysql. To avoid an error with case-insensivity i added BINARY to my queries!

-> SELECT * FROM table WHERE BINARY ...

After i did this i got an other problem: When i use this line i get completely wrong output

-> SELECT * FROM table WHERE BINARY position > '18' ORDER BY position asc

(position is an int(11) field)

in this exmaple in the database there is no position-field that is decimal compared higher than 18, the position-field goes from 1-18, but i get several lines to be higher than 18 -> fields where position is 1,2,3,4,5,6,7,8 and 9


I know i could use the query without BINARY and using something other to compare case-sensitive, but why is this wrong output happening??? I wan't to know it because in my brain i can not understand why 1 - 9 is higher than 18 when binary compared??

Options: ReplyQuote


Subject
Written By
Posted
BINARY Comparison
June 14, 2005 02:57PM
June 14, 2005 03:22PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.