chanchelkumar Posted April 2, 2008 Share Posted April 2, 2008 Hi all, I am working with some random numbers... I want to get the largest number in a field before inserting a value.. Any body please help me... I want to rename a variable with that number+1 so as to get it unique, before insertion.. Please help me... Quote Link to comment Share on other sites More sharing options...
pocobueno1388 Posted April 2, 2008 Share Posted April 2, 2008 Why not just put an auto-increment field in the table? To get the max value +1 you would do this: SELECT MAX(field)+1 AS highest FROM table Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.