STRUCT
The STRUCT
function is used to create a structure that can contain multiple values of different types. The composition of the structure is described by a series of field names and corresponding data types. Structures are very useful when dealing with complex data, as they conveniently organize multiple related data together.
Syntax
Example
- Create a struct that contains the company name and the number of employees:
- Use the
named_struct
function to create a structure with explicit field names: - Use structs in queries combined with other fields: