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

38 阅读1分钟

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

知识来源:docs-opengauss.osinfra.cn/zh/ 

创建表。

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

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

    ini复制代码db_tpcc=> INSERT INTO mytable values (100);
    

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

    sql复制代码INSERT 0 1
    
  • 查看表中数据:

    sql复制代码db_tpcc=> SELECT * from mytable;
     firstcol 
    ----------
          100
    (1 row)
    

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

知识来源:docs-opengauss.osinfra.cn/zh/