How to get next ID in a table ?

Hi, suppose a table has first column as ID that stores unique ID in this format : P000001,P000002,P000003... and so on. How can i get the next value through query ?After getting that ID insert query w...