I'm working on a function where I create a 2d array something along the lines of...
{{1, 'John', 'Smith'}, {1, 'Jane', 'Doe'}, {3, 'Tony', 'Stark'}}
The function I'm building combines data from a few different queries and even though it may seem unnecessary is the only way I can seem to combine my data so far.
The problem I'm running into is getting my array displayed as a table.
I'm calling my function like this:
SELECT * FROM my_func();
^^ And getting the array output from above. ^^
I'd like to be able to return something like this: - Even better if I can label the columns.
Col1   | Col2   | Col3
1      | John   | Smith
2      | Jane   | Doe
3      | Tony   | Stark
I tried: SELECT * FROM my_func(); which was better, but still unusable as it put everything into a single column.
Col1
1
John
Smith
2
Jane
Doe
3
Tony
Stark