CREATE TABLE t1(id varchar2(32) primary key,name VARCHAR2(32) ,age VARCHAR2(32) );comment on column t1.id is 'id';comment on column t1.name is '姓名';comment on column t1.age is '年龄';…
大家好,我是小皓. 一.背景 今天在博主练习MYS创建表操作时遇到一个语法报错,就想着来和大家分享一下MYSQL如何在创建表时添加判断条件: ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '[if not exists] tb_name(…
创建数据库表.添加注释的方法: create table WARNINGRECORD ( RecordID ) primary key not null ); comment on column WARNINGRECORD.RecordID is '告警编号'; 现在想通过pl/sql语句块执行,代码如下: declare tableExist number; begin ) into tableExist from all_tables where TABLE_NAME='WARNINGREC…
CREATE TABLE t1(id varchar2(32) primary key,name VARCHAR2(32) ,age VARCHAR2(32) ) 添加表注释:COMMENT ON table t1 IS '个人信息'; 添加字段注释: comment on column t1.id is 'id'; comment on column t1.name is '姓名';comment on column t1.age is '年龄';…