+ 2
How to set a auto increment in a column
suggest me answer! i need it for oracle database
4 odpowiedzi
+ 6
if you use a graphical interface then there should be a checkbook for that called AI or sth like that
+ 1
AUTO_INCREMENT
+ 1
Very often we would like the value of the primary key field to be created automatically every time a new record is inserted.
We would like to create an auto-increment field in a table.
My SQL
CREATE TABLE Persons
(
ID int NOT NULL AUTO_INCREMENT,
LastName varchar(255) NOT NULL,
FirstName varchar(255),
Address varchar(255),
City varchar(255),
PRIMARY KEY (ID)
)
SQL Server
CREATE TABLE Persons
(
ID int IDENTITY(1,1) PRIMARY KEY,
LastName varchar(255) NOT NULL,
FirstName varchar(255),
Address varchar(255),
City varchar(255)
)
0
thanks to all.