1

我在 SQL 开发人员中有以下代码,当我尝试运行代码来创建表时,它在这一行失败:'exists_flag varchar2(1) y/n,'

 create table moulds
 (mould_id  number,
 mould_type varchar2(50),
 mould_description varchar2(240),
 exists_flag varchar2(1) y/n,
 locate_id  number,
 );

谁能看到这条线有什么问题以及为什么它一直说“缺少右括号”?

 create table moulds
 (mould_id  number,
 mould_type varchar2(50),
 mould_description varchar2(240),
 check (exists_flag in ( 'y', 'n' )),
 locate_id  number,
 PRIMARY KEY (mould_id)
 );
4

1 回答 1

4

替换y/n

check (exists_flag in ( 'y', 'n' ))
于 2012-07-12T12:02:56.680 回答