Here's my MySQL Table
When I carry out the following query : SELECT MAX( Animal_ID ) FROM info_table
I get "9"
Shouldn't it be 10 ?
How can I resolve the error ?
Thanks!
Here's my MySQL Table
When I carry out the following query : SELECT MAX( Animal_ID ) FROM info_table
I get "9"
Shouldn't it be 10 ?
How can I resolve the error ?
Thanks!
My guess is that animal_id
is being stored as a character field rather than as a numeric field. If you want the numeric max, try this:
select max(animal_id + 0)
from info_table
When you add two values together in MySQL and one is a character string, then the initial numeric characters (if any) are converted to a number.