sql语句缺失右括号,,在线等
createtablefinance(idintidentityprimarykey,//设置自增序列namevarchar2(20)notnull,dateDateno...
create table finance(
id int identity primary key, //设置自增序列
name varchar2(20) not null,
date Date not null,
remark varchar2(40)
); 展开
id int identity primary key, //设置自增序列
name varchar2(20) not null,
date Date not null,
remark varchar2(40)
); 展开
2个回答
展开全部
由于不知道楼主使用的是哪种数据库,故以下我给你提供了三个版本的。
Mysql:
create table finance(
id int auto_increment primary key not null, //设置自增序列
name varchar(20) not null,
date Date not null,
remark varchar(40)
);
=====================华丽的分割线=========================
MSSQL:
create table finance(
id int identity(1,1) primary key not null, //设置自增序列
name varchar(20) not null,
date Date not null,
remark varchar(40)
);
=====================华丽的分割线=========================
Oracle:
create table finance(
id number(4) not null primary key,
name varchar2(20) not null,
date Date not null,
remark varchar2(40)
);
-- 建立序列:
-- Create sequence
create sequence finance_sequence
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;
-- 建立触发器
create trigger "finance_trigger" before
insert on sifinance or each row when(new.id is null)
begin
select finance_sequence.nextval into:new.id from
dual;
end;
有问题欢迎提问,满意请采纳!
Mysql:
create table finance(
id int auto_increment primary key not null, //设置自增序列
name varchar(20) not null,
date Date not null,
remark varchar(40)
);
=====================华丽的分割线=========================
MSSQL:
create table finance(
id int identity(1,1) primary key not null, //设置自增序列
name varchar(20) not null,
date Date not null,
remark varchar(40)
);
=====================华丽的分割线=========================
Oracle:
create table finance(
id number(4) not null primary key,
name varchar2(20) not null,
date Date not null,
remark varchar2(40)
);
-- 建立序列:
-- Create sequence
create sequence finance_sequence
minvalue 1
maxvalue 999999999999999999999999999
start with 1
increment by 1
cache 20;
-- 建立触发器
create trigger "finance_trigger" before
insert on sifinance or each row when(new.id is null)
begin
select finance_sequence.nextval into:new.id from
dual;
end;
有问题欢迎提问,满意请采纳!
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询