<分区>
我对自动增量有疑问,同时数字发生了变化并且没有保持我定义的增量。 附上表格的代码和图片。
// Table 3 creation (Coupon)
try {
java.sql.Statement stmt3 = conn.createStatement();
sql = "create table Coupon("
+ "ID bigint not null primary key generated always as identity(start with 1, increment by 1), "
+ "TITLE varchar(30) not null, "
+ "START_DATE DATE not null, "
+ "END_DATE DATE not null,"
+ "AMOUNT INTEGER not null,"
+ "TYPE varchar(10) not null,"
+ "MESSAGE varchar(30) not null,"
+ "PRICE double not null,"
+ "IMAGE varchar(200) not null)";
stmt3.executeUpdate(sql);
System.out.println("success:" + sql);
} catch (SQLException e) {
System.out.println(e.getMessage());
}