Help Center/
GaussDB/
Developer Guide(Distributed_3.x)/
Database Quick Start/
Operating a Database/
Creating and Managing Tables/
Viewing Data
Updated on 2024-05-07 GMT+08:00
Viewing Data
- Run the following command to query information about all tables in a database in the system catalog pg_tables:
1
gaussdb=# SELECT * FROM pg_tables;
- Run the \d+ command of the gsql tool to query table attributes:
1
gaussdb=# \d+ customer_t1;
- Run the following command to query the data volume of table customer_t1:
1
gaussdb=# SELECT count(*) FROM customer_t1;
- Run the following command to query all data in the table customer_t1:
1
gaussdb=# SELECT * FROM customer_t1;
- Run the following command to query only the data in the column c_customer_sk:
1
gaussdb=# SELECT c_customer_sk FROM customer_t1;
- Run the following command to filter repeated data in the column c_customer_sk:
1
gaussdb=# SELECT DISTINCT( c_customer_sk ) FROM customer_t1;
- Run the following command to query all data whose column c_customer_sk is 3869:
1
gaussdb=# SELECT * FROM customer_t1 WHERE c_customer_sk = 3869;
- Run the following command to collate data based on the column c_customer_sk:
1
gaussdb=# SELECT * FROM customer_t1 ORDER BY c_customer_sk;
Parent topic: Creating and Managing Tables
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
The system is busy. Please try again later.
For any further questions, feel free to contact us through the chatbot.
Chatbot