MLDB implements a query language based upon SQL's select
syntax.
This is used both for efficient evaluation of expressions, and to
specify queries.
SELECT <
Select Expression
>
specifies the columns to put in the output datasetNAMED <
Value Expression
>
specifies the name of the rows in the output datasetFROM <
From Expression
>
specifies the dataset(s) to select fromWHEN <
When Expression
>
specifies which values to put in the output dataset based on their timestampWHERE <
Where Expression
>
specifies which rows in the input contribute to the output datasetGROUP BY <
Group-By Expression
>
specifies how to group the output for aggregate functionsHAVING <
Where Expression
>
specifies the groups to selectORDER BY <
Order-By Expression
>
specifies the order to output the resultsLIMIT <int>
specifies the number of output rowsOFFSET <int>
specifies how many output rows to skip--
denotes the start of a line comment and /* ... */
denotes a block comment which can span multiple lines"
) denote identifiers and single-quote characters (i.e. '
) denote strings_
), and don't clash with a reserved word such as from
or timestamp
. In all other cases they must be surrounded by double-quote characters (i.e. "
). Double-quote characters within quotes must be doubled (i.e. ""
).
François says "hello", eh?
in a query, you would need to
surround it in double-quotes (because of the spaces, punctuation and non-ASCII character) and double the inner double-quotes: "François says ""hello"", eh?"
..
) is an indirection operator, much like the minus, or dash, character (i.e. -
) is a mathematical operator, so while either may appear in an quoted identifier, confusion and excess quoting can be avoided by avoiding this practice. The only punctuation mark which is not and will never be an operator is the underscore character (i.e. _
).