PDA

View Full Version : Get the highest ID from a table


levani
08-05-2009, 11:02 AM
How can I get the highest ID from a database table?

abduraooft
08-05-2009, 11:11 AM
Use max() function (http://dev.mysql.com/doc/refman/5.0/en/group-by-functions.html#function_max).
(Hope you are not going to calculate the next value to inserted to an auto increment column :))