I would like to fetch the result set from a function for each row of a parent result. Here is table1:
column
------
a1
a2
a3
a4
a5
I would like to loop through table1 and get the result of the function for each item in the column. The function returns a table.
SELECT (SELECT * FROM functionReturnsTable(a.column))
FROM (SELECT column FROM table1) a
I have tried the query above however I get the error
Only one expression can be specified in the select list when the subquery is not introduced with EXISTS.
How can I write a query/function that will loop through table1 and combine the result of each item into a single table?