SQL 101
Zipstack uses the Trino query engine that conforms to the ANSI SQL standard. This adherence to the standard empowers Zipstack users to effortlessly combine their data tools such as BI and ETL tools with any underlying data source we support.
Listed below are some notes on common usage scenarios
Use of single and double quotes in SQL
Use the single quotation only for string literals.
Example 'europe'
Use the double quotation only for schema/table/column names
Example: WHERE hypertables.default.sales_2023."net.profit" > 100000
When Schema, table or column name has a dot in them
When there is a schema, table and column names with a dot in them, always use the double quotation to represent the item. In the previous example, net.profit is the name of a column. Whenever this column is used in a SQL query, make sure it is represented within double quotation marks.
When a schema, table or column name is a reserved SQL keyword
When a schema, table or column name is a SQL language reserved word, use double quotation marks to identify them as an entity. For example, let us assume that there is a column called default in the sales_2023 hypertable. This column need to be addressed as follows:
WHERE hypertables.default.sales_2023."default" = "NO"