Help Center/ GaussDB/ Developer Guide(Distributed_V2.0-2.x)/ Database Quick Start/ Operating a Database/ Creating and Managing Tables/ Viewing Data
Updated on 2025-08-19 GMT+08:00
Viewing Data
- Run the following command to query information about all tables in a database in the system catalog pg_tables:
1openGauss=# SELECT * FROM pg_tables;
- Run the \d+ command of the gsql tool to query table attributes:
1openGauss=# \d+ customer_t1;
- Run the following command to query the data volume of table customer_t1:
1openGauss=# SELECT count(*) FROM customer_t1;
- Run the following command to query all data in the table customer_t1:
1openGauss=# SELECT * FROM customer_t1;
- Run the following command to query only the data in the column c_customer_sk:
1openGauss=# SELECT c_customer_sk FROM customer_t1;
- Run the following command to filter repeated data in the column c_customer_sk:
1openGauss=# SELECT DISTINCT( c_customer_sk ) FROM customer_t1;
- Run the following command to query all data whose column c_customer_sk is 3869:
1openGauss=# SELECT * FROM customer_t1 WHERE c_customer_sk = 3869;
- Run the following command to collate data based on the column c_customer_sk:
1openGauss=# SELECT * FROM customer_t1 ORDER BY c_customer_sk;
Parent topic: Creating and Managing Tables
What is your overall rating for this page?
0
1
2
3
4
5
6
7
8
9
10
Very dissatisfiedVery satisfied
Thank you very much for your feedback. We will continue working to improve the documentation.
The system is busy. Please try again later.