I have an inline TVF that accept a primary key of a table and computes a value out of the row with that primary key (actually a table with that value as part of the select, but whatever).
Now I want to do something like this:
SELECT something
FROM table1
CROSS APPLY thefunction(table1primarykey) func
ON func.computedvalue = func.computedvalue(table2primarykey)
Problem is I did not use table2 yet, and could not do it, because the only way table1 and table2 are joined is via the same function return value.
How can I do something like this?
How about