Data Type | Remarks for Data Type |
---|---|
CHAR | |
VARCHAR | |
STRING | |
BOOLEAN | |
BINARY | |
VARBINARY | |
BYTES | |
DECIMAL | Supports fixed precision and scale. |
TINYINT | |
SMALLINT | |
INTEGER | |
BIGINT | |
FLOAT | |
DOUBLE | |
DATE | |
TIMESTAMP | |
TIMESTAMP_LTZ |
SELECT
statement is:
table_expression
refers to any data set in Chainbase Network. It could be an existing table, or VALUES clause, the joined results of multiple existing tables, or a subquery. The following would read all rows from blocks
.
select_list
specification *
means the query will resolve all columns.
Instead, a select_list
can specify a subset of available columns or make calculations using said columns. For example, if token_transfers
has columns name token_id
, token_value
and token_decimal
you could write the following query:
WHERE
clause:
ORDER BY
clause causes the result rows to be sorted according to the specified expression(s). If two rows are equal according to the leftmost expression, they are compared according to the next expression and so on. If they are equal according to all specified expressions, they are returned in an implementation-dependent order.
LIMIT
clause constrains the number of rows returned by the SELECT
statement. In general, this clause is used in conjunction with ORDER BY
to ensure that the results are deterministic.
The following example selects the latest 10 blocks on blocks table.
SELECT DISTINCT
is specified, all duplicate rows are removed from the result set (one row is kept from each group of duplicates).
COUNT
, SUM
, AVG(average)
, MAX(maximum)
and MIN(minimum)
over a set of rows.
GROUP BY
clause is also supported for aggregating data.
INSERT
statements are used to add rows to a dataset.
Syntax: