Daniel Tschinder wrote:
> 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 noposition-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
Do not use BINARY when comparing against INTEGER columns (it makes no sense - digits are not case sensitive anyway). Using BINARY in the case above forces an alphabetical comparison instead of a numerical. And alphabetically, "18" comes before e.g. "2".
--
felix
Please use
BBCode to format your messages in this forum.