SELECT MAX(id) FROM TableName
Will return 12 if the table contains the data you posted. There are a few possibilities why you could get another result
- id's 11 and 12 are not in the table
- you have a condition in the select which eliminates those id's from the result
- id's 11 and 12 are inserted to the table in another session and the transaction isn't committed yet.