语句
SQL 查询的主结构是其语句。无论语句是独立存在还是多语句查询的一部分,每个语句都必须以分号结尾。以下示例包含四个通用 SQL 语句—CREATE TABLE、INSERT、SELECT 和 COMMIT:
=> CREATE TABLE comments (id INT, comment VARCHAR);
CREATE TABLE
=> INSERT INTO comments VALUES (1, 'Hello World');
OUTPUT
--------
1
(1 row)
=> SELECT * FROM comments;
id | comment
----+-------------
1 | Hello World
(1 row)
=> COMMIT;
COMMIT
=>
本节内容
- ALTER 语句
- ACTIVATE DIRECTED QUERY
- BEGIN
- CALL
- COMMENT ON 语句
- COMMIT
- CONNECT TO VERTICA
- COPY
- COPY LOCAL
- COPY FROM VERTICA
- CREATE 语句
- DEACTIVATE DIRECTED QUERY
- DELETE
- DISCONNECT
- DO
- DROP 语句
- END
- EXPLAIN
- EXPORT TO DELIMITED
- EXPORT TO JSON
- EXPORT TO ORC
- EXPORT TO PARQUET
- 导出到 VERTICA
- GET DIRECTED QUERY
- GRANT 语句
- INSERT
- MERGE
- PROFILE
- RELEASE SAVEPOINT
- REVOKE 语句
- ROLLBACK
- ROLLBACK TO SAVEPOINT
- SAVE QUERY
- SAVEPOINT
- SELECT
- SET 语句
- SHOW
- SHOW CURRENT
- SHOW DATABASE
- SHOW NODE
- SHOW SESSION
- SHOW USER
- 启动事务处理
- TRUNCATE TABLE
- UPDATE