例子
考虑 COMPANY 表有以下记录 -
id | name | age | address | salary
----+-------+-----+------------+--------
1 | Paul | 32 | California | 20000
2 | Allen | 25 | Texas | 15000
3 | Teddy | 23 | Norway | 20000
4 | Mark | 25 | Rich-Mond | 65000
5 | David | 27 | Texas | 85000
6 | Kim | 22 | South-Hall | 45000
7 | James | 24 | Houston | 10000
(7 rows)
以下是截断的示例 -
testdb=# TRUNCATE TABLE COMPANY;
现在,COMPANY 表被截断,以下是 SELECT 语句的输出 -
testdb=# SELECT * FROM CUSTOMERS;
id | name | age | address | salary
----+------+-----+---------+--------
(0 rows)