「已注销」 2023-03-10 17:44 采纳率: 14.3%
浏览 76

在数据库中创建视图是如何添加comment注释?

在数据库中创建视图时如何添加comment注释?如何设置不可为空

  • 写回答

1条回答 默认 最新

  • 凉城┓.〆 2023-03-10 18:34
    关注

    mysql:

    create table users(id int primary key comment ‘注释’);
    

    postgresql:

    create table if not table_name
    (
        id         bigserial,
        dt         date        not null,
        created_at timestamp default current_timestamp,
        updated_at timestamp default current_timestamp
    );
    
    comment on table table_name is '表名';
    comment on column table_name.dt is '值班日';
    

    若有用,望采纳,谢谢

    评论 编辑记录

报告相同问题?

问题事件

  • 创建了问题 3月10日