I searched a lot, but I have no chance that several columns will be returned in the subquery at once. The following code works, but it sucks:
SELECT (SELECT Column1 FROM dbo.fnGetItemPath(ib.Id)) AS Col1, (SELECT Column2 FROM dbo.fnGetItemPath(ib.Id)) AS Col2, (SELECT Column3 FROM dbo.fnGetItemPath(ib.Id)) AS Col3 FROM ItemBase ib
I really have no idea how to pass ib.Id functions and get columns Column1, Column2, Column3 without calling the fnGetItemPath function 3 times.
Thank you in advance
source share