一口一个openGauss食用小技巧(五)

27 阅读1分钟

#openGauss #入门 #安装 #数据库

创建表。

  • 创建一个名称为mytable,只有一列的表。字段名为firstcol,字段类型为integer。

    db_tpcc=>  CREATE TABLE mytable (firstcol int);
    
    
    CREATE TABLE
    
  • 向表中插入数据:

    db_tpcc=> INSERT INTO mytable values (100);
    

    当结果显示为如下信息,则表示插入数据成功。

    INSERT 0 1
    
  • 查看表中数据:

    db_tpcc=> SELECT * from mytable;
     firstcol 
    ----------
          100
    (1 row)
    

#openGauss #入门 #安装 #数据库