This is an automated email from the ASF dual-hosted git repository.

xudong963 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow-datafusion.git


The following commit(s) were added to refs/heads/master by this push:
     new 2e30a2429 add create view explanation (#3925)
2e30a2429 is described below

commit 2e30a2429ec6100c37ef36fced585bf3c44dbfc6
Author: Burak <[email protected]>
AuthorDate: Sat Oct 22 08:38:54 2022 +0300

    add create view explanation (#3925)
    
    * add create view explanation
    
    * correct prettier check
---
 docs/source/user-guide/sql/ddl.md | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/docs/source/user-guide/sql/ddl.md 
b/docs/source/user-guide/sql/ddl.md
index 118314fdc..0d82768aa 100644
--- a/docs/source/user-guide/sql/ddl.md
+++ b/docs/source/user-guide/sql/ddl.md
@@ -107,6 +107,39 @@ DROP TABLE users;
 DROP TABLE IF EXISTS nonexistent_table;
 ```
 
+## CREATE VIEW
+
+View is a virtual table based on the result of a SQL query. It can be created 
from an existing table or values list.
+
+<pre>
+CREATE VIEW <i><b>view_name</i></b> AS statement;
+</pre>
+
+```sql
+CREATE TABLE users AS VALUES(1,2),(2,3),(3,4),(4,5);
+CREATE VIEW test AS SELECT column1 FROM users;
+SELECT * FROM test;
++---------+
+| column1 |
++---------+
+| 1       |
+| 2       |
+| 3       |
+| 4       |
++---------+
+```
+
+```sql
+CREATE VIEW test AS VALUES(1,2),(5,6);
+SELECT * FROM test;
++---------+---------+
+| column1 | column2 |
++---------+---------+
+| 1       | 2       |
+| 5       | 6       |
++---------+---------+
+```
+
 ## DROP VIEW
 
 Removes the view from DataFusion's catalog.

Reply via email to