Statements
The primary structure of a SQL query is its statement.
The primary structure of a SQL query is its statement. Whether a statement stands on its own, or is part of a multi-statement query, each statement must end with a semicolon. The following example contains four common SQL statements—CREATE TABLE, INSERT, SELECT, and 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
=>
In this section
- ACTIVATE DIRECTED QUERY
- ALTER statements
- BEGIN
- CALL
- COMMENT ON statements
- COMMIT
- CONNECT TO VERTICA
- COPY
- COPY FROM VERTICA
- COPY LOCAL
- CREATE statements
- DEACTIVATE DIRECTED QUERY
- DELETE
- DISCONNECT
- DO
- DROP statements
- END
- EXECUTE DATA LOADER
- EXPLAIN
- EXPORT TO DELIMITED
- EXPORT TO JSON
- EXPORT TO ORC
- EXPORT TO PARQUET
- EXPORT TO VERTICA
- GET DIRECTED QUERY
- GRANT statements
- INSERT
- LOCK TABLE
- MERGE
- PROFILE
- RELEASE SAVEPOINT
- REMOVE RESTORE POINT FROM ARCHIVE
- REPLICATE
- REVOKE statements
- ROLLBACK
- ROLLBACK TO SAVEPOINT
- SAVE QUERY
- SAVE RESTORE POINT TO ARCHIVE
- SAVEPOINT
- SELECT
- SET statements
- SHOW
- SHOW CURRENT
- SHOW DATABASE
- SHOW NODE
- SHOW SESSION
- SHOW USER
- START TRANSACTION
- TRUNCATE TABLE
- UPDATE