Home > Database > Mysql Tutorial > ORA-00957:重复的列名_MySQL

ORA-00957:重复的列名_MySQL

WBOY
Release: 2016-05-27 13:46:27
Original
4337 people have browsed it

1、错误描述

ORA-00957: 重复的列名
Copy after login

2、错误原因
SQL> create table info(
  2     stu_id varchar2(7) not null, 
  3     stu_name varchar2(20) not null,
  4     stu_age varchar(2) not null,
  5     stu_age number(2) not null,
  6     stu_seat number(2) not null,
  7     enter_date date,
  8     stu_add varchar2(100) default '',
  9     class_no varchar2(4) not null
 10  );
 
create table info(
   stu_id varchar(7) not null,
   stu_name varchar2(20) not null,
   stu_age varchar(2) not null,
   stu_age number(2) not null,
   stu_seat number(2) not null,
   enter_date date,
   stu_add varchar2(100) default '',
   class_no varchar2(4) not null
)
 
Copy after login
创建数据库表时,定义了同名字段stu_age,所以报错

3、解决办法

create table info(
   stu_id varchar(7) not null,
   stu_name varchar2(20) not null,
   stu_age varchar(2) not null,
   stu_seat number(2) not null,
   enter_date date,
   stu_add varchar2(100) default '',
   class_no varchar2(4) not null
)
Copy after login
去掉一个stu_age字段
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template