Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Get Max ID from table
- SELECT MAX(id) FROM table;
- -- Get Next ID from table
- SELECT nextval('table_id_seq');
- -- Set Next ID Value to MAX ID
- SELECT setval('table_id_seq', (SELECT MAX(id) FROM table));
Advertisement
Add Comment
Please, Sign In to add comment