Skip to content

Commit

Permalink
rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
huaxingao committed May 1, 2020
1 parent 2807784 commit f357d36
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 37 deletions.
42 changes: 21 additions & 21 deletions docs/sql-ref-syntax-aux-show-columns.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,33 +62,33 @@ CREATE TABLE customer(

-- List the columns of `customer` table in current database.
SHOW COLUMNS IN customer;
+---------+
| col_name|
+---------+
| cust_cd|
| name|
|cust_addr|
+---------+
+---------+
| col_name|
+---------+
| cust_cd|
| name|
|cust_addr|
+---------+

-- List the columns of `customer` table in `salesdb` database.
SHOW COLUMNS IN salesdb.customer;
+---------+
| col_name|
+---------+
| cust_cd|
| name|
|cust_addr|
+---------+
+---------+
| col_name|
+---------+
| cust_cd|
| name|
|cust_addr|
+---------+

-- List the columns of `customer` table in `salesdb` database
SHOW COLUMNS IN customer IN salesdb;
+---------+
| col_name|
+---------+
| cust_cd|
| name|
|cust_addr|
+---------+
+---------+
| col_name|
+---------+
| cust_cd|
| name|
|cust_addr|
+---------+
```

### Related Statements
Expand Down
32 changes: 16 additions & 16 deletions docs/sql-ref-syntax-ddl-truncate-table.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,33 +62,33 @@ TRUNCATE TABLE table_identifier [ partition_spec ]
CREATE TABLE Student (name STRING, rollno INT) PARTITIONED BY (age INT);

SELECT * FROM Student;
+----+------+---+
|name|rollno|age|
+----+------+---+
| ABC| 1| 10|
| DEF| 2| 10|
| XYZ| 3| 12|
+----+------+---+
+----+------+---+
|name|rollno|age|
+----+------+---+
| ABC| 1| 10|
| DEF| 2| 10|
| XYZ| 3| 12|
+----+------+---+

-- Removes all rows from the table in the partition specified
TRUNCATE TABLE Student partition(age=10);

-- After truncate execution, records belonging to partition age=10 are removed
SELECT * FROM Student;
+----+------+---+
|name|rollno|age|
+----+------+---+
| XYZ| 3| 12|
+----+------+---+
+----+------+---+
|name|rollno|age|
+----+------+---+
| XYZ| 3| 12|
+----+------+---+

-- Removes all rows from the table from all partitions
TRUNCATE TABLE Student;

SELECT * FROM Student;
+----+------+---+
|name|rollno|age|
+----+------+---+
+----+------+---+
+----+------+---+
|name|rollno|age|
+----+------+---+
+----+------+---+
{% endhighlight %}

### Related Statements
Expand Down

0 comments on commit f357d36

Please sign in to comment.