I have a table my_ids with single column id. Next, I have a table-valued function fn_getMatches(id). What I want is to iterate through table my_ids and for each id call function fn_getMatches(id) and aggregate all results in one table. How do I do that without explicit loop?
I tried:
select *
from my_ids ids
full outer join fn_getMatches(ids.id) on 1=2
where ids.id is null
But it returns:
Msg 4104, Level 16, State 1, Line 11
The multi-part identifier “ids.id” could not be bound.
Having no idea what the function does, or what results you expect, maybe try:
Removed the
WHEREclause and theONcriteria from your initial attempt.