oracle中创建表的sql语句如何添加default约束

2024-11-25 10:53:59
推荐回答(3个)
回答1:

create table bookType(
bookTypeId number primary key,
parentId number not null,
bookTypeName varchar2(20) not null,
isDelete number not null default 1,
context varchar2(40)
)

回答2:

alter table booktype modify isdelete default 1;
--感觉你们都是用sqlserver语法在解决

回答3:

create table bookType(
bookTypeId number primary key,
parentId number not null,
bookTypeName varchar2(20) not null,
isDelete number not null default 1 , --1为可用,0为不可用
context varchar2(40)
)

alter table bookType
alter isDelete set default 1