SQL functions are implemented in the Connect AI query API. As a result, these functions are available across all data sources with the same consistent API. Three categories of functions are available: string, date, and math.
The API interprets all SQL function inputs as either strings or column identifiers. All literals must be escaped as strings with single quotes. For example, contrast the SQL Server syntax and provider syntax for the DATENAME function:
Window functions allow you to create computed fields from a group of rows (a window) that return a result for each row, as opposed to one computed result for a set of rows, as is the case with aggregate functions.
Copy
Ask AI
SELECT Name, Role, Earnings, COUNT() OVER (PARTITION BY Role) FROM Employees
The provider supports column names, constants, and results of other functions as parameters to functions. The following are all valid uses of SQL functions:
Copy
Ask AI
SELECT CONCAT('Mr.', SPACE(2), firstname, SPACE(4), lastname) FROM Account