Guest QueenZ Posted November 25, 2006 Share Posted November 25, 2006 Hi,I need to get last user_id from my table to create a new one! e.g.user_id usern passw1 QZ passw2 Elf motdepasse3 Blah paroleNow you see that '3' is the last user_id in my table to create a new one I need to get how many users are there. Link to comment Share on other sites More sharing options...
jteixeira Posted November 27, 2006 Share Posted November 27, 2006 select count(*)from "TableName" Link to comment Share on other sites More sharing options...
jesh Posted November 27, 2006 Share Posted November 27, 2006 I think this may be more appropriate: SELECT MAX(user_id) FROM TableName Link to comment Share on other sites More sharing options...
justsomeguy Posted November 27, 2006 Share Posted November 27, 2006 Or, you can set the id column to be an autonumber and it will keep track of itself. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now