Most people are used to the operations of other databases. One field is an auto-incrementing sequence field, but Oracle-related help is queried.
View the relatedArticle, Repost this article to share with you
// Create a sequence
Create sequence car_guid increment by 1;
// Create a table
Create Table car
(
Guid number not null primary key,
Phoneid char (11) not null,
Username varchar (20) not null
);
// Add comments
Comment on table car is 'positioning information user table ';
Comment on column car. GUID is 'auto-incrementing field ';
Comment on column car. phoneid is 'unique telephone identification ';
Comment on column car. username is 'user name ';
// Add a record
Insert into car (guid, phoneid, username) values (car_guid.nextval, '000000', 'zhangsan ');
// Submit
Commit;
// Trigger
Create or replace trigger trigger_car_guid_insert
Before insert on car
For each row
Begin
Select carguidseq. nextval into: New. guid from SYS. Dual;
End;