Search
 
SCRIPT & CODE EXAMPLE
 

SQL

postgres set sequence value to max id

SELECT setval('table_id_seq', (SELECT MAX(id) FROM table));
Comment

update postgres sequence to max

SELECT setval('table_id_seq', (SELECT MAX(id) FROM table)+1);
Comment

setval max id postgresql sequence

SELECT setval('table_id_seq', (SELECT MAX(id) FROM table));
Comment

PREVIOUS NEXT
Code Example
Sql :: how to unlock table in mysql 
Sql :: how to open postgresql in mac 
Sql :: rename column postgres 
Sql :: psql get sequences 
Sql :: mysql group by day 
Sql :: dump mysql 
Sql :: oracle turn off constraint 
Sql :: sql getdate date only 
Sql :: how to run mysql in git bash 
Sql :: mysql delete row 
Sql :: oracle list dblink 
Sql :: mysql your password does not satisfy the current policy requirements 
Sql :: append column sql 
Sql :: athena query timestamp greater than 
Sql :: bulk kill mysql processlist 
Sql :: how to delay stored procedure execution in sql server 
Sql :: create table if not exists sql 
Sql :: alter sequence set current value oracle 
Sql :: show indexes mysql 
Sql :: show table status command in mysql 
Sql :: mysql show foreign keys 
Sql :: sql command to find foreign key references 
Sql :: Mysql Workbench takes very long time to execute the first query 
Sql :: bigquery get current date 
Sql :: sql server alter table add column datetime default current_timestamp 
Sql :: capitalize 1st letter in sql server 
Sql :: ddl view 
Sql :: mysql get character set 
Sql :: mysql drop trigger 
Sql :: sql sample tables with data 
ADD CONTENT
Topic
Content
Source link
Name
9+2 =