auto increment ID in H2 database

前端 未结 5 1655
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-24 01:57

Is there a way to have an auto_incrementing BIGINT ID for a table. It can be defined like so

id bigint auto_increment

but that has no effec

5条回答
  •  [愿得一人]
    2020-12-24 02:27

    You can also use default:

    create table if not exists my(id int auto_increment primary key,s text);
    insert into my values(default,'foo');
    

提交回复
热议问题