164 Star 224 Fork 1.2K

openGauss / docs

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
查看数据.md 1.01 KB
一键复制 编辑 原始数据 按行查看 历史
liyang 提交于 2021-03-12 16:14 . fix issue

查看数据

  • 使用系统表pg_tables查询数据库所有表的信息。

    SELECT * FROM pg_tables;
  • 使用gsql的\d+命令查询表的属性。

    \d+ customer_t1;
  • 执行如下命令查询表customer_t1的数据量。

    SELECT count(*) FROM customer_t1;
  • 执行如下命令查询表customer_t1的所有数据。

    SELECT * FROM customer_t1;
  • 执行如下命令只查询字段c_customer_sk的数据。

    SELECT c_customer_sk FROM customer_t1;
  • 执行如下命令过滤字段c_customer_sk的重复数据。

    SELECT DISTINCT( c_customer_sk ) FROM customer_t1;
  • 执行如下命令查询字段c_customer_sk为3869的所有数据。

    SELECT * FROM customer_t1 WHERE c_customer_sk = 3869;
  • 执行如下命令按照字段c_customer_sk进行排序。

    SELECT * FROM customer_t1 ORDER BY c_customer_sk;
1
https://gitee.com/opengauss/docs.git
git@gitee.com:opengauss/docs.git
opengauss
docs
docs
3.0.0

搜索帮助