使用名为'' PASSWORD"的列创建表格

时间:2014-08-07 06:42:18

标签: mysql passwords create-table identity-column reserved

这是我的脚本和我得到的错误。我做错了什么?

create table PHONE_USERS (
 TELEPHONE_NUMBER VARCHAR2(80)  NOT NULL, PRIMARY KEY 
 FIRST_NAME VARCHAR2(80),
 LAST_NAME VARCHAR2(80),
 KEYMAP_LASTNAME CHAR(4), 
"PASSWORD" VARCHAR2(80),
 CONSTRAINT LAST_NAME UNIQUE (TELEPNONE_NUMBER)
 );
  

命令行错误:7列:31
  错误报告 -
  SQL错误:ORA-00904:“TELEPNONE_NUMBER”:标识符无效   00904. 00000 - “%s:无效标识符”
  *原因:
  *行动:

2 个答案:

答案 0 :(得分:1)

TELEPNONE_NUMBER拼写错误。必须是TELEPHONE_NUMBER

create table PHONE_USERS (
 TELEPHONE_NUMBER VARCHAR2(80)  NOT NULL PRIMARY KEY, 
 FIRST_NAME VARCHAR2(80),
 LAST_NAME VARCHAR2(80),
 KEYMAP_LASTNAME CHAR(4), 
"PASSWORD" VARCHAR2(80),
 CONSTRAINT LAST_NAME UNIQUE (TELEPHONE_NUMBER)
 );

答案 1 :(得分:0)

发生此错误,因为我认为在NOT NULLTELEPHONE_NUMBER拼写不匹配之后放置了逗号。

TELEPNONE_NUMBER更改为TELEPHONE_NUMBER

create table PHONE_USERS (
 TELEPHONE_NUMBER VARCHAR2(80)  NOT NULL PRIMARY KEY, 
 FIRST_NAME VARCHAR2(80),
 LAST_NAME VARCHAR2(80),
 KEYMAP_LASTNAME CHAR(4), 
"PASSWORD" VARCHAR2(80),
 CONSTRAINT LAST_NAME UNIQUE (TELEPHONE_NUMBER)
 );